mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1182677 - Support calling a function during mach command dispatch; r=smacleod
This will give us the ability to execute custom code at command dispatch time. We can use this for global tests before dispatch. --HG-- extra : commitid : 5vfmSqOis4W extra : rebase_source : c285b16007c4b604b164d079a275198c8760e480
This commit is contained in:
parent
b696aaef57
commit
4121a5645c
@ -61,6 +61,11 @@ class MachRegistrar(object):
|
||||
if handler.pass_context and not context:
|
||||
raise Exception('mach command class requires context.')
|
||||
|
||||
if context:
|
||||
prerun = getattr(context, 'pre_dispatch_handler', None)
|
||||
if prerun:
|
||||
prerun(context, handler, args=kwargs)
|
||||
|
||||
if handler.pass_context:
|
||||
instance = cls(context)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user