summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/main.py b/main.py
index d993ee4e..ba40d56b 100755
--- a/main.py
+++ b/main.py
@@ -23,6 +23,7 @@ if __name__ == '__main__':
23del magic 23del magic
24 24
25import getpass 25import getpass
26import imp
26import netrc 27import netrc
27import optparse 28import optparse
28import os 29import os
@@ -167,16 +168,15 @@ def _MyRepoPath():
167def _MyWrapperPath(): 168def _MyWrapperPath():
168 return os.path.join(os.path.dirname(__file__), 'repo') 169 return os.path.join(os.path.dirname(__file__), 'repo')
169 170
171_wrapper_module = None
172def WrapperModule():
173 global _wrapper_module
174 if not _wrapper_module:
175 _wrapper_module = imp.load_source('wrapper', _MyWrapperPath())
176 return _wrapper_module
177
170def _CurrentWrapperVersion(): 178def _CurrentWrapperVersion():
171 VERSION = None 179 return WrapperModule().VERSION
172 pat = re.compile(r'^VERSION *=')
173 fd = open(_MyWrapperPath())
174 for line in fd:
175 if pat.match(line):
176 fd.close()
177 exec line
178 return VERSION
179 raise NameError, 'No VERSION in repo script'
180 180
181def _CheckWrapperVersion(ver, repo_path): 181def _CheckWrapperVersion(ver, repo_path):
182 if not repo_path: 182 if not repo_path: