"""All parameters about platforms, versions and environments included in one object."""
def__init__(self):
self.mac=None
self.pc=None
self.platform=sys.platform
self.applicationName=None# name of the application we're running in
self.name=os.name
self.version=version# the robofab version
self.numberVersion=numberVersion
self._hasNagged=False
self._willNag=True
self._timedOut=False
self._license=False
self.run=True
# get some platform information
ifself.name=='mac'orself.name=='posix':
ifself.platform=="darwin":
self.mac="X"
else:
self.mac="pre-X"
elifself.name=='nt':
# if you know more about PC & win stuff, add it here!
self.pc=True
else:
raiseRoboFabError,"We're running on an unknown platform."
# collect versions
self.pyVersion=sys.version[:3]
self.inPython=False
self.flVersion=None
self.inFontLab=False
# are we in FontLab?
try:
fromFLimportfl
self.applicationName=fl.filename
self.inFontLab=True
self.flVersion=fl.version
exceptImportError:pass
ifnotself.inFontLab:
self.inPython=True
# see if we have W
self.supportsW=False
ifnotself.inFontLab:
try:
importW
self.supportsW=True
exceptImportError:
self.supportsW=False
def__repr__(self):
return"[Robofab is running on %s. Python version: %s, Mac stuff: %s, PC stuff: %s, FontLab stuff: %s, FLversion: %s]"%(self.platform,self.pyVersion,self.mac,self.pc,self.inFontLab,self.flVersion)