svn-gvsig-desktop / branches / v2_0_0_prep / build / buildman / bin / bmplugins / DepManPlugIn.py @ 27363
History | View | Annotate | Download (2.3 KB)
1 |
from bmbase.IPlugIn import IPlugIn |
---|---|
2 |
from bmbase.PlugInManager import PlugInManager |
3 |
from bmcore.BMUtil import BMUtil |
4 |
from xml.dom import minidom |
5 |
import os |
6 |
import sys |
7 |
|
8 |
class DepManPlugIn(IPlugIn): |
9 |
def __init__(self): |
10 |
IPlugIn.__init__(self)
|
11 |
self._depmanDataPath = sys.path[0]+os.path.sep+".."+os.path.sep+"plugins-data"+os.path.sep+"depman" |
12 |
self._supportedPlatforms = ["all","mac","linux","win"] |
13 |
self._supportedArchs = ["all","i386","ppc","ppc64","x86_64","universal"] |
14 |
self._supportedLibraryTypes = ["none","dynamic","static","framework"] |
15 |
self._supportedCompilers = ["all","vs6","vs7","vs8","gcc3","gcc4"] |
16 |
#tries to guess host OS values
|
17 |
self._osplatform="unknown" |
18 |
self._osdistribution="unknown" |
19 |
self._osarch="unknown" |
20 |
self._oscompiler="unknown" |
21 |
if sys.platform=="darwin": |
22 |
self._osplatform="mac" |
23 |
self._osarch="universal" |
24 |
self._oscompiler="gcc4" |
25 |
elif sys.platform == "linux2" or sys.platform == "linux1": |
26 |
self._osplatform="linux" |
27 |
self._osarch="i386" |
28 |
self._oscompiler="gcc4" |
29 |
elif sys.platform == "win32" or sys.platform == "win64": |
30 |
self._osplatform="win" |
31 |
self._osarch="i386" |
32 |
self._oscompiler="vs8" |
33 |
|
34 |
def init(self): |
35 |
pass
|
36 |
|
37 |
def initFromXML(self,node): |
38 |
pass
|
39 |
|
40 |
def execute(self): |
41 |
pass
|
42 |
|
43 |
def getSupportedPlatforms(self): |
44 |
return self._supportedPlatforms |
45 |
|
46 |
def getSupportedArchs(self): |
47 |
return self._supportedArchs |
48 |
|
49 |
def getSupportedLibraryTypes(self): |
50 |
return self._supportedLibraryTypes |
51 |
|
52 |
def getSupportedCompilers(self): |
53 |
return self._supportedCompilers |
54 |
|
55 |
def getOSPlatform(self): |
56 |
return self._osplatform |
57 |
|
58 |
def getOSDistribution(self): |
59 |
return self._osdistribution |
60 |
|
61 |
def getOSArch(self): |
62 |
return self._osarch |
63 |
|
64 |
def getOSCompiler(self): |
65 |
return self._oscompiler |
66 |
|
67 |
def getDepManPath(self): |
68 |
dr = os.getenv("DEPMAN_REPO")
|
69 |
if not dr is None: |
70 |
return dr;
|
71 |
if sys.platform == "linux2" or sys.platform == "linux1": |
72 |
dr = os.getenv("HOME")+os.path.sep+".depman" |
73 |
return dr;
|
74 |
if sys.platform == "win32" or sys.platform == "win64": |
75 |
#ex: c:\documents and setting\user\DepMan
|
76 |
dr = os.getenv("USERPROFILE")+os.path.sep+"DepMan" |
77 |
return dr;
|
78 |
if sys.platform == "darwin": |
79 |
dr = os.path.sep + "Developer" + os.path.sep + "DepMan" |
80 |
return dr;
|
81 |
return None |
82 |
|
83 |
def getDepManDataPath(self): |
84 |
return self._depmanDataPath |
85 |
|
86 |
PlugInManager().registerPlugIn("DepManPlugIn",DepManPlugIn())
|
87 |
|
88 |
|