本文整理匯總了Python中pyglass.app.PyGlassEnvironment.PyGlassEnvironment.initializeExplicitAppSettings方法的典型用法代碼示例。如果您正苦於以下問題:Python PyGlassEnvironment.initializeExplicitAppSettings方法的具體用法?Python PyGlassEnvironment.initializeExplicitAppSettings怎麽用?Python PyGlassEnvironment.initializeExplicitAppSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyglass.app.PyGlassEnvironment.PyGlassEnvironment
的用法示例。
在下文中一共展示了PyGlassEnvironment.initializeExplicitAppSettings方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: script
# 需要導入模塊: from pyglass.app.PyGlassEnvironment import PyGlassEnvironment [as 別名]
# 或者: from pyglass.app.PyGlassEnvironment.PyGlassEnvironment import initializeExplicitAppSettings [as 別名]
# When running outside of a PyGlass application, the PyGlass environment must be initialized
# explicitly, including specifying the relationship between the run script (this file) and
# the resource directory. This must be done before importing database classes so that the
# database import correctly locates the database file and initializes the model classes to
# that file.
from pyaid.system.SystemUtils import SystemUtils
from pyaid.file.FileUtils import FileUtils
from pyglass.app.PyGlassEnvironment import PyGlassEnvironment
location = FileUtils.getDirectoryOf(__file__)
PyGlassEnvironment.initializeExplicitAppSettings(
FileUtils.createPath(location, '..', 'resources', isDir=True),
FileUtils.createPath(location, '..', 'resources', 'local', isDir=True) )
#---------------------------------------------------------------------------------------------------
# RUN TEST SCRIPT
from cadence.models.tracks.Tracks_SiteMap import Tracks_SiteMap
from cadence.svg.CadenceDrawing import CadenceDrawing
model = Tracks_SiteMap.MASTER
session = model.createSession()
siteMap = session.query(model).filter(model.index == 13).first()
fileName = 'test_new.svg'
drawing = CadenceDrawing(fileName, siteMap)
xFed = siteMap.xFederal