##// END OF EJS Templates
extensions: move uisetup and extsetup to standalone functions...
Jun Wu -
r29461:7d88fde2 default
parent child Browse files
Show More
@@ -127,6 +127,21 b' def load(ui, name, path):'
127 127 fn(loaded=True)
128 128 return mod
129 129
130 def _runuisetup(name, ui):
131 uisetup = getattr(_extensions[name], 'uisetup', None)
132 if uisetup:
133 uisetup(ui)
134
135 def _runextsetup(name, ui):
136 extsetup = getattr(_extensions[name], 'extsetup', None)
137 if extsetup:
138 try:
139 extsetup(ui)
140 except TypeError:
141 if extsetup.func_code.co_argcount != 0:
142 raise
143 extsetup() # old extsetup with no ui argument
144
130 145 def loadall(ui):
131 146 result = ui.configitems("extensions")
132 147 newindex = len(_order)
@@ -148,19 +163,10 b' def loadall(ui):'
148 163 ui.traceback()
149 164
150 165 for name in _order[newindex:]:
151 uisetup = getattr(_extensions[name], 'uisetup', None)
152 if uisetup:
153 uisetup(ui)
166 _runuisetup(name, ui)
154 167
155 168 for name in _order[newindex:]:
156 extsetup = getattr(_extensions[name], 'extsetup', None)
157 if extsetup:
158 try:
159 extsetup(ui)
160 except TypeError:
161 if extsetup.func_code.co_argcount != 0:
162 raise
163 extsetup() # old extsetup with no ui argument
169 _runextsetup(name, ui)
164 170
165 171 # Call aftercallbacks that were never met.
166 172 for shortname in _aftercallbacks:
General Comments 0
You need to be logged in to leave comments. Login now