Skip to content

Commit

Permalink
Merge pgenome:~/project/moa11 into moa.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
mfiers committed May 24, 2012
2 parents 1a153d2 + 59897db commit 6030823
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion template2/simple.moa
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ parameter_category_order:
parameters:
process:
category: ''
default: true
default: 'echo "Need to specify a process"'
help: The command to execute
optional: false
type: string
Expand Down
5 changes: 3 additions & 2 deletions template2/sync.moa
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ modification_date: Thu, 30 Jun 2011 21:25:53
name: sync
parameters:
source:
help: The directory to keep in sync with
optional: false
help: The directory to keep in sync with. If not specified, this
template just keeps local directory synced
optional: true
type: string
ignore:
help: ignore these names (space separated list)
Expand Down
34 changes: 21 additions & 13 deletions template2/sync.run.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ def errex(message):
if ignore:
print "ignoring", ignore

if not source:
errex("source directory is not defined")

if not os.path.isdir(source):
errex("Source is not a directory")

print "Source directory: %s" % source
if source:
print "source directory is not defined"
SOURCE=False
elif os.path.isdir(source):
SOURCE=True
print "Source directory: %s" % source
else:
SOURCE=False
print "No source - just syncing"

lastAccessTime = 0
lastAccessDir = None
Expand Down Expand Up @@ -79,15 +81,21 @@ def errex(message):
sys.exit(-1)


print "start parsing the source directory"
originalConf = os.path.join(original, '.moa', 'config')

sourcelist = [x for x in os.listdir(source) if os.path.isdir(x)]
if os.path.exists('_ref'):
sourcelist.append('_ref')
if SOURCE:
print "start parsing the source directory"
sourcelist = [x for x in os.listdir(source) if os.path.isdir(x)]
if os.path.exists('_ref'):
sourcelist.append('_ref')

#make sure we're not copying the file to itself
sourcelist.remove(original)

#make sure we're not copying the file to itself
sourcelist.remove(original)
else:
#no sourcelist - just get a list of local directories
sourcelist = [x for x in os.listdir('.') if os.path.isdir(x)]

print "Syncing %s to %d target(s)" % (original, len(sourcelist))
for indir in sourcelist:
Expand Down

0 comments on commit 6030823

Please sign in to comment.