Exemplo n.º 1
0
Arquivo: inst.py Projeto: fdev31/pyg
 def from_url(url, packname=None):
     with TempDir() as tempdir:
         packname = packname or urlparse.urlsplit(url).path.split('/')[-1]
         if '#egg=' in url:
             url, packname = url.split('#egg=')
         path = os.path.join(tempdir, packname)
         logger.info('Installing {0} from {1}', packname, url)
         with open(path, 'w') as f:
             f.write(request(url))
         Installer.from_file(path, packname)
Exemplo n.º 2
0
Arquivo: gist.py Projeto: Malex/pyg
 def get_file_content(self, filename):
     url = 'https://gist.github.com/raw/{0}/{1}'.format(self.gist_id, filename)
     return request(url)
Exemplo n.º 3
0
Arquivo: gist.py Projeto: Malex/pyg
 def data(self):
     if self._data is not None:
         return self._data
     url = 'https://gist.github.com/api/v1/json/{0}'.format(self.gist_id)
     self._data = json.loads(request(url))
     return self._data