summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/main.py b/main.py
index d993ee4e..7a09c6ba 100755
--- a/main.py
+++ b/main.py
@@ -23,10 +23,10 @@ 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
29import re
30import sys 30import sys
31import time 31import time
32import urllib2 32import urllib2
@@ -167,16 +167,15 @@ def _MyRepoPath():
167def _MyWrapperPath(): 167def _MyWrapperPath():
168 return os.path.join(os.path.dirname(__file__), 'repo') 168 return os.path.join(os.path.dirname(__file__), 'repo')
169 169
170_wrapper_module = None
171def WrapperModule():
172 global _wrapper_module
173 if not _wrapper_module:
174 _wrapper_module = imp.load_source('wrapper', _MyWrapperPath())
175 return _wrapper_module
176
170def _CurrentWrapperVersion(): 177def _CurrentWrapperVersion():
171 VERSION = None 178 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 179
181def _CheckWrapperVersion(ver, repo_path): 180def _CheckWrapperVersion(ver, repo_path):
182 if not repo_path: 181 if not repo_path: