MCPcopy Index your code
hub / github.com/davispuh/MySQL-for-Python-3 / _build_egg

Function _build_egg

distribute_setup.py:91–116  ·  view source on GitHub ↗
(egg, tarball, to_dir)

Source from the content-addressed store, hash-verified

89
90
91def _build_egg(egg, tarball, to_dir):
92 # extracting the tarball
93 tmpdir = tempfile.mkdtemp()
94 log.warn('Extracting in %s', tmpdir)
95 old_wd = os.getcwd()
96 try:
97 os.chdir(tmpdir)
98 tar = tarfile.open(tarball)
99 _extractall(tar)
100 tar.close()
101
102 # going in the directory
103 subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
104 os.chdir(subdir)
105 log.warn('Now working in %s', subdir)
106
107 # building an egg
108 log.warn('Building a Distribute egg in %s', to_dir)
109 _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir)
110
111 finally:
112 os.chdir(old_wd)
113 # returning the result
114 log.warn(egg)
115 if not os.path.exists(egg):
116 raise IOError('Could not build the egg.')
117
118
119def _do_download(version, download_base, to_dir, download_delay):

Callers 1

_do_downloadFunction · 0.85

Calls 3

_extractallFunction · 0.85
_python_cmdFunction · 0.85
closeMethod · 0.80

Tested by

no test coverage detected