本文整理汇总了Python中Configuration.Configuration.load方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.load方法的具体用法?Python Configuration.load怎么用?Python Configuration.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration.Configuration
的用法示例。
在下文中一共展示了Configuration.load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mux
# 需要导入模块: from Configuration import Configuration [as 别名]
# 或者: from Configuration.Configuration import load [as 别名]
return audioExtraction
def mux( self ):
mp4box = os.path.join( self.hostDirectory,
os.path.basename( self.applications["mp4box"] ) )
multiplexing = ''
multiplexing += '"' + mp4box + '" -fps 25 -add "' + \
self.output_video + '" -add "' + \
self.output_audio + '" "' + \
self.output_mux + '"'
return multiplexing
if __name__ == '__main__':
Configuration.load( 'avs_processor.conf' )
Configuration.set( 'C:\\Users\\Administrator\\Desktop\\in' , 'directories',
'input' )
Configuration.set( 'C:\\Users\\Administrator\\Desktop\\out' , 'directories',
'output' )
Configuration.set( 'C:\\OD_Encoding' , 'directories',
'host' )
Configuration.set( 'x264', 'videoSettings', 'outputFormat' )
Configuration.set( '--profile main --level 3.1 --preset slow --bitrate \
1500 --no-cabac --bframes 3 --ref 1 --b-pyramid 0 \
--keyint 50 --min-keyint 50 --no-scenecut \
--rc-lookahead 50', 'videoSettings', 'cmdOptions' )
Configuration.set( 'MP4', 'audioSettings', 'outputFormat' )
Configuration.set( '64000', 'audioSettings', 'bitrate' )
示例2: __init__
# 需要导入模块: from Configuration import Configuration [as 别名]
# 或者: from Configuration.Configuration import load [as 别名]
def __init__( self ):
self.passwd = '|:33w|:r3U'
#Configuration.all = Configuration.load( '..\\conf\\avs.ini' )
Configuration.db_conn = Configuration.load( 'conf\\db.ini' )
self.connect()
示例3: Configuration
# 需要导入模块: from Configuration import Configuration [as 别名]
# 或者: from Configuration.Configuration import load [as 别名]
from ClientConnection import ClientConnection
from Configuration import Configuration
from EventMessage import EventMessage
from swarming_heads.eminterface.EventMessage import EventMessageBuilder
from swarming_heads.eminterface.Events import EventType, EventList
import logging
import sys
if __name__ == '__main__':
#Get a new Configuration instance
config = Configuration('../em_interface.cfg');
#Load parameters from the config file
config.load()
#Setup logging for the application
numeric_log_level = getattr(logging, config.loglevel.upper(), None)
logging.basicConfig(filename=config.logfile,level=numeric_log_level, format='%(asctime)s - %(levelname)s - %(message)s')
#Get a new client instance
client = ClientConnection(config)
#Initiate a connection between the client and the event manager.
success, err_msg = client.connect()
if not success:
sys.stderr.write('Error connecting to event manager: ' + err_msg + '\n')
sys.exit(1)
#Write 5 messages
for i in range(5):
示例4: STLExplorerFrame
# 需要导入模块: from Configuration import Configuration [as 别名]
# 或者: from Configuration.Configuration import load [as 别名]
class STLExplorerFrame(wx.Frame):
def __init__(self,parent,title):
wx.Frame.__init__(self,parent,title=title,size=(1024, 800),
style = wx.DEFAULT_FRAME_STYLE | wx.MAXIMIZE)
#style=wx.MINIMIZE_BOX|wx.SYSTEM_MENU| wx.CAPTION|wx.CLOSE_BOX|wx.CLIP_CHILDREN)
self.spMain = wx.SplitterWindow(self)
self.spSTL = wx.SplitterWindow(self.spMain)
self.renderPanel = RenderPanel(self.spSTL)
self.infoPanel = InfoPanel(self.spSTL, "green")
self.spSTL.SplitHorizontally(self.renderPanel, self.infoPanel)
# percent ocupation of SLT preview
self.spSTL.SetSashGravity(0.7)
self.filePanel = wx.Panel(self.spMain,style=wx.SUNKEN_BORDER)
self.spMain.SplitVertically(self.filePanel,self.spSTL, 400)
self.AddStatusBar()
self.AddToolBar()
self.AddFileTree()
self.infogrid = InfoGrid(self.infoPanel)
# open config file if exist
self.conf = Configuration()
self.conf.load()
self.conf.wxParent = self
lastPath = self.conf.GetlastSelPath()
if lastPath:
self.fileTree.DirExplorer(lastPath)
self.slic3r = Slic3r()
self.lastGCodeGen = ""
# self.plotbut = wx.Button(self.p2,-1,"Browse for STL file ", size=(140,40),pos=(10,10))
# self.plotbut.Bind(wx.EVT_BUTTON,self.plot)
def AddStatusBar(self):
self.statusbar = self.CreateStatusBar()
self.statusbar.SetStatusText("Click on the Load Button to load a STL file")
def AddToolBar(self):
toolbar = self.CreateToolBar()
quitToolBar = toolbar.AddLabelTool(wx.ID_ANY, 'Quit', wx.Bitmap('./icon/exit.png'))
treeToolBar = toolbar.AddLabelTool(wx.ID_ANY, 'Tree', wx.Bitmap('./icon/tree.png'))
slicerToolBar = toolbar.AddLabelTool(wx.ID_ANY, 'Slic3r', wx.Bitmap('./icon/GCode.png'))
printToolBar = toolbar.AddLabelTool(wx.ID_ANY, '3D Print', wx.Bitmap('./icon/3DPrinter.png'))
infoGCode = toolbar.AddLabelTool(wx.ID_ANY, 'Info GCode', wx.Bitmap('./icon/Info.png'))
toolbar.Realize()
# ToolBar events
self.Bind(wx.EVT_TOOL, self.OnQuit, quitToolBar)
self.Bind(wx.EVT_TOOL, self.OnTreeUpdate, treeToolBar)
self.Bind(wx.EVT_TOOL, self.OnSlicerToolBar, slicerToolBar)
self.Bind(wx.EVT_TOOL, self.OnPrintToolBar, printToolBar)
self.Bind(wx.EVT_TOOL, self.OnInfoGCode, infoGCode)
def AddFileTree(self):
# Create our tree and put it into the file panel
self.fileTree = FileNavTree(self.filePanel)
# Add box Size
sizerFile = wx.BoxSizer(wx.VERTICAL)
# Add the tree to the box sizer
sizerFile.Add(self.fileTree, 1, wx.EXPAND, 0)
# Set the size of the file panel to that required by the tree
self.filePanel.SetSizer(sizerFile)
# Bind the OnSelChanged method to the tree
self.fileTree.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnfileTreeSelChanged)
def OnfileTreeSelChanged(self, event):
# Get the selected item object
item = event.GetItem()
pathFile = self.fileTree.GetPyData(item)
if pathFile == None:
return
self.statusbar.SetStatusText("Start Render")
self.renderPanel.RenderSTL(pathFile)
self.statusbar.SetStatusText("End Render")
self.conf.SetLastSelFile(pathFile)
self.statusbar.SetStatusText("Use W,S,F,R keys and mouse to interact with the model ")
self.InfoUpdate()
def InfoUpdate(self):
gridData = [
['Path', self.conf.GetlastSelPath()],
['File', self.conf.GetLastSelFile()]
]
if self.lastGCodeGen:
gridData = gridData + self.GCodeInfo(self.lastGCodeGen)
self.infogrid.UpdateInfo(gridData)
def GCodeInfo(self, gcodeFile):
gcode = GCode(open(gcodeFile, "rU"))
xdims = (gcode.xmin, gcode.xmax, gcode.width)
#.........这里部分代码省略.........