本文整理汇总了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)