當前位置: 首頁>>代碼示例>>Python>>正文


Python PuddleConfig.load方法代碼示例

本文整理匯總了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)
開發者ID:RaphaelRochet,項目名稱:puddletag,代碼行數:43,代碼來源:puddlesettings.py


注:本文中的puddlestuff.puddleobjects.PuddleConfig.load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。