Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fiers committed Sep 27, 2012
1 parent b835ca2 commit 21a000d
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions lib/python/moa/plugin/system/project.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright 2009-2011 Mark Fiers
# The New Zealand Institute for Plant & Food Research
#
#
# This file is part of Moa - http://github.com/mfiers/Moa
#
#
# Licensed under the GPL license (see 'COPYING')
#
#
"""
**project** - Simple plugin to ease maintaining project data
------------------------------------------------------------
Expand All @@ -16,30 +16,28 @@
* project: the 'title' varialbe of the first parent project
"""
import re
import os
import sys
import Yaco
import subprocess as sp
import re

import Yaco
from moa.sysConf import sysConf
import moa.logger as l
import moa.ui


def hook_prepare_3():

#see if we can find a project directory -
#see if we can find a project directory -
job = sysConf.job
lookat = os.path.abspath(sysConf.job.wd)
while True:

if lookat == '/': break


if lookat == '/':
break

templateFile = os.path.join(lookat, '.moa', 'template')
if not os.path.exists(templateFile):
lookat = os.path.dirname(lookat)
continue

td = Yaco.Yaco()
td.load(templateFile)

Expand All @@ -52,7 +50,7 @@ def hook_prepare_3():
job.conf.setPrivateVar(
'_project',
re.sub("^[0-9]+\.+", "", os.path.basename(lookat)))

#get this wd's job conf
projectConf = os.path.join(lookat, '.moa', 'config')
if os.path.exists(projectConf):
Expand Down

0 comments on commit 21a000d

Please sign in to comment.