本文整理匯總了Python中puddlestuff.puddleobjects.PuddleConfig.load方法的典型用法代碼示例。如果您正苦於以下問題:Python PuddleConfig.load方法的具體用法?Python PuddleConfig.load怎麽用?Python PuddleConfig.load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類puddlestuff.puddleobjects.PuddleConfig
的用法示例。
在下文中一共展示了PuddleConfig.load方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from puddlestuff.puddleobjects import PuddleConfig [as 別名]
# 或者: from puddlestuff.puddleobjects.PuddleConfig import load [as 別名]
def __init__(self, parent = None):
QWidget.__init__(self, parent)
def inttocheck(value):
if value:
return Qt.Checked
return Qt.Unchecked
cparser = PuddleConfig()
self.extpattern = QLineEdit()
self.extpattern.setText(cparser.load('playlist', 'extpattern','%artist% - %title%'))
self.extinfo = QCheckBox(translate("Playlist Settings", '&Write extended info'), self)
self.connect(self.extinfo, SIGNAL('stateChanged(int)'), self.extpattern.setEnabled)
self.extinfo.setCheckState(inttocheck(cparser.load('playlist', 'extinfo',1, True)))
self.extpattern.setEnabled(self.extinfo.checkState())
self.reldir = QCheckBox(translate("Playlist Settings", 'Entries &relative to working directory'))
self.reldir.setCheckState(inttocheck(cparser.load('playlist', 'reldir',0, True)))
self.windows_separator = QCheckBox(translate("Playlist Settings", 'Use windows path separator (\\)'))
self.windows_separator.setCheckState(inttocheck(cparser.load('playlist', 'windows_separator',0, True)))
self.filename = QLineEdit()
self.filename.setText(cparser.load('playlist', 'filepattern','puddletag.m3u'))
label = QLabel(translate("Playlist Settings", '&Filename pattern.'))
label.setBuddy(self.filename)
hbox = QHBoxLayout()
hbox.addSpacing(10)
hbox.addWidget(self.extpattern)
vbox = QVBoxLayout()
[vbox.addWidget(z) for z in (self.extinfo, self.reldir, self.windows_separator,
label, self.filename)]
vbox.insertLayout(1, hbox)
vbox.addStretch()
vbox.insertSpacing(3, 5)
vbox.insertSpacing(5, 5)
self.setLayout(vbox)