Skip to content

Commit

Permalink
some reorganizing - preparing for implementation of "moa -r"
Browse files Browse the repository at this point in the history
  • Loading branch information
mfiers committed Apr 3, 2011
1 parent b3bf9a9 commit ab53f71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions bin/moa
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,12 @@ plugins = moa.plugin.PluginHandler(sysConf.getPlugins())
# Initialize the job object
wd = os.getcwd()
moa.version.fixOld(wd)
job = moa.job.Job(wd)
job.plugins = plugins


#use of cwd is deprecated
plugins.register(cwd = wd)
plugins.register(sysConf = sysConf)
plugins.register(wd = wd)
plugins.register(job = job)

### Determine project root (if there is one)
#projectRoot = moa.project.findProjectRoot(job)
Expand Down Expand Up @@ -134,6 +132,9 @@ parser.add_option("-r", "--recursive", dest="recursive",

def run():

job = moa.job.Job(wd)
plugins.register(job = job)

## Aks the job & backend if they want to add to the options
job.defineOptions(parser)

Expand All @@ -145,11 +146,6 @@ def run():
## Parse the options
(options, args) = parser.parse_args()

## make sure that the options are accessible to the plugins
plugins.register(options = options, args = args)
job.options = options
job.args = args

## Proper setting of verbosity - after parsing of the command line
if options.verbose:
moa.logger.setVerbose()
Expand All @@ -168,6 +164,11 @@ def run():
plugins.register(executeCommand=commands)
plugins.register(originalCommand=commands[0])

## make sure that the options are accessible to the plugins
plugins.register(options = options, args = args)
job.options = options
job.args = args

## Ask the job if it's is ok with
## these commands (might want to change order, or insert
## stuff
Expand Down Expand Up @@ -205,7 +206,7 @@ def run():
plugins.run("postCommand")
raise
else:
#No callback, defer this to the job
#No callback, defer this to the backend

#first see if we need to fork - if this is a background job
if options.background:
Expand All @@ -229,9 +230,8 @@ def run():

plugins.run("finish")
sys.exit(rc)


## Command dispatcher
## Main dispatcher
if __name__ == "__main__":
try:
run()
Expand Down
2 changes: 1 addition & 1 deletion lib/python/moa/plugin/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def _unsetCallback(wd, data):
Does the actual unset..
"""
job = moa.job.Job(wd)
print "unsetting", " ".join(data.unset), "in", wd
#print "unsetting", " ".join(data.unset), "in", wd
for u in data.unset:
try:
del job.conf[u]
Expand Down

0 comments on commit ab53f71

Please sign in to comment.