svn-gvsig-desktop / branches / v2_0_0_prep / build / buildman / bin / bmplugins / PrepareSystemPlugIn.py @ 27363
History | View | Annotate | Download (918 Bytes)
1 |
from bmbase.IPlugIn import IPlugIn |
---|---|
2 |
from bmbase.PlugInManager import PlugInManager |
3 |
from bmcore.BMUtil import BMUtil |
4 |
import os |
5 |
import sys |
6 |
import shutil |
7 |
|
8 |
class PrepareSystemPlugIn(IPlugIn): |
9 |
def __init__(self): |
10 |
IPlugIn.__init__(self)
|
11 |
|
12 |
def init(self): |
13 |
self.addGoal("init", "Prepares the system with the buildman user directory with an example plugin") |
14 |
while self._arguments.read("init"): |
15 |
self.setExecute(True) |
16 |
|
17 |
def execute(self): |
18 |
print "Executing Plugin:" + str(self.__class__) + "\n" |
19 |
util = BMUtil() |
20 |
bmpath = util.buildmanPlugInPath() |
21 |
try:
|
22 |
util.mkdir(bmpath) |
23 |
#shutil.copy(sys.path[0]+os.path.sep+"bmplugins"+os.path.sep+"TestPlugIn.py_",util.buildmanPlugInPath()+os.path.sep+"TestPlugIn.py")
|
24 |
except:
|
25 |
self.reportError("Error creating buildman directory or copying test plugin") |
26 |
return False |
27 |
return True |
28 |
|
29 |
PlugInManager().registerPlugIn("PrepareSystemPlugIn",PrepareSystemPlugIn())
|
30 |
|
31 |
|