コード例 #1
0
ファイル: report.py プロジェクト: BoldingBruggeman/gotm
    def __init__(self,defaultfont=None):
        xmlstore.util.referencedobject.__init__(self)
        
        reportschema = os.path.join(common.getDataRoot(),'schemas/report/gotmgui.schema')
        self.store = xmlstore.xmlstore.TypedStore(reportschema)

        self.defaultstore = xmlstore.xmlstore.TypedStore(reportschema)

        # Set some default properties.
        self.defaultstore['Figures/Width'      ].setValue(10)
        self.defaultstore['Figures/Height'     ].setValue(8)
        self.defaultstore['Figures/Resolution' ].setValue(96)
        self.defaultstore['Figures/FontScaling'].setValue(100)
        self.defaultstore['Figures/FontName'   ].setValue(defaultfont)

        self.store.setDefaultStore(self.defaultstore)
コード例 #2
0
ファイル: scenario.py プロジェクト: BoldingBruggeman/gotm
guiscenarioversion = 'gotmgui-0.5.0'
savedscenarioversion = 'gotm-4.0.0'

# Import modules from standard Python library
import os, shutil, re, datetime, sys

# Import our own custom modules
import xmlstore.xmlstore, xmlstore.util, xmlstore.datatypes
import common, namelist

# Some parts of the schemas will be loaded from the GOTM source directory.
# For the developer's version, the source directory can be found one level below the GUI.
# For the frozen version (py2exe build), the required files are present in the gotmsrc
# subdirectory directly below the GUI directory.
if hasattr(sys,'frozen'):
    srcdir = os.path.abspath(os.path.join(common.getDataRoot(),'gotmsrc'))
else:
    srcdir = os.path.abspath(os.path.join(common.getDataRoot(),'../src'))
if os.path.isdir(srcdir): xmlstore.xmlstore.Schema.knownpaths['gotmsrc'] = srcdir

schemadir = None

class NamelistStore(xmlstore.xmlstore.TypedStore):

    def __init__(self,*args,**kwargs):
        super(NamelistStore,self).__init__(*args,**kwargs)

        self.namelistextension = self.root.templatenode.getAttribute('namelistextension')

    @classmethod
    def fromNamelists(cls,path,prototypepath=None,targetversion=None,strict = False,requireplatform=None,root=None):
コード例 #3
0
ファイル: scenario.py プロジェクト: BoldingBruggeman/gotm
 def getSchemaInfo(cls):
     global schemadir
     if schemadir is None: schemadir = os.path.join(common.getDataRoot(),'schemas/scenario')
     return xmlstore.xmlstore.schemainfocache[schemadir]
コード例 #4
0
ファイル: settings.py プロジェクト: gotm-model/code
 def __init__(self, schema=None):
     if schema is None:
         schema = os.path.join(common.getDataRoot(), "schemas/settings/gotmgui.schema")
     xmlstore.xmlstore.TypedStore.__init__(self, schema)