Skip to content

Commit

Permalink
ask for a title if none is specified for "moa new"
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fiers committed Nov 29, 2012
1 parent aa98caf commit 21f9ec0
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions moa/plugin/system/newjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def new(job, args):

if job.conf.title and job.conf.is_local('title'):
title = job.conf.title

if args.title:
title = args.title

Expand All @@ -66,16 +67,6 @@ def new(job, args):
else:
params.append(a)

# if targetdir != '.':
# fulltarget = os.path.abspath(targetdir)
# if not os.path.exists(fulltarget):
# moa.ui.message("Creating directory %s" % targetdir)
# os.makedirs(fulltarget)

# os.chdir(fulltarget)
# #create a new job for the target dir
# job = moa.job.Job(fulltarget)

wd = job.wd

if os.path.exists(os.path.join(wd, '.moa', 'template')) and not args.force:
Expand All @@ -94,6 +85,9 @@ def new(job, args):
except moa.exceptions.InvalidTemplate:
moa.ui.exitError("Invalid template: %s" % template)

if title is None or str(title).strip() == "":
title = moa.ui.askUser('title: ', "")

job.conf['title'] = title

for p in params:
Expand Down

0 comments on commit 21f9ec0

Please sign in to comment.