PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/logilab-astng-0.23.1/test/regrtest_data/descriptor_crash.py

#
Python | 31 lines | 8 code | 3 blank | 20 comment | 0 complexity | a2e24e9f66f5179d7197af1b815acae1 MD5 | raw file
 1# -*- coding: iso-8859-1 -*-
 2# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 3# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 4# copyright 2003-2010 Sylvain Thenault, all rights reserved.
 5# contact mailto:thenault@gmail.com
 6#
 7# This file is part of logilab-astng.
 8#
 9# logilab-astng is free software: you can redistribute it and/or modify it
10# under the terms of the GNU Lesser General Public License as published by the
11# Free Software Foundation, either version 2.1 of the License, or (at your
12# option) any later version.
13#
14# logilab-astng is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
17# for more details.
18#
19# You should have received a copy of the GNU Lesser General Public License along
20# with logilab-astng. If not, see <http://www.gnu.org/licenses/>.
21
22import urllib
23
24class Page(object):
25    _urlOpen = staticmethod(urllib.urlopen)
26
27    def getPage(self, url):
28        handle = self._urlOpen(url)
29        data = handle.read()
30        handle.close()
31        return data