python类Config()的实例源码

wxfb.py 文件源码 项目:fritzchecksum 作者: mementum 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def config(self):
        return wx.Config.Get()
wxfb.py 文件源码 项目:fritzchecksum 作者: mementum 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def postrd(self, value, obj):
        # cPickle expexts str but wx.Config returns unicode cPickle
        # gives me a standard list which needs to be turned into our
        # special MutableSequence
        iterable = cPickle.loads(str(value))
        return self.defclass(iterable=iterable, owner=self, instance=obj)
bomsaway.py 文件源码 项目:Boms-Away 作者: Jeff-Ciesielski 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def _load_config(self):
        # Handle legacy file location
        if os.path.exists(self._legacy_dir):
            print("Migrating config from legacy location")
            shutil.move(self._legacy_dir, self.config_dir)

        # Create the kicad bom manager folder if it doesn't already exist
        if not os.path.exists(self.config_dir):
            os.makedirs(self.config_dir)

        self.filehistory = wx.FileHistory(8)
        self.config = wx.Config("BOMsAway",
                                localFilename=self.config_file,
                                style=wx.CONFIG_USE_LOCAL_FILE)
        self.filehistory.Load(self.config)
padherder_proxy.py 文件源码 项目:padherder_proxy 作者: jgoldshlag 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def main():
    app = wx.App(False)
    if len(sys.argv) >= 2 and sys.argv[1] == '-test':
        config = wx.Config("padherder_proxy_test")
        print "In test mode"
    else:
        config = wx.Config("padherder_proxy")
    wx.ConfigBase.Set(config)
    frame = MainWindow(None, "Padherder Proxy v%s" % PH_PROXY_VERSION)

    host = config.Read("host") or socket.gethostbyname(socket.gethostname())

    logger = dnsproxy.MyDNSLogger(frame.dns_tab)
    thread.start_new_thread(dnsproxy.serveDNS, (logger, frame.main_tab, frame))

    try:
        app_config = proxy.ProxyConfig(port=8080, host=host)
        app_server = ProxyServer(app_config)
        app_master = dump.DumpMaster(app_server, dump.Options(app_host='mitm.it', app_port=80, app=True))
        frame.app_master = app_master
        thread.start_new_thread(app_master.run, ())
    except:
        evt = custom_events.wxStatusEvent(message='Error initalizing mitm proxy:\n' + traceback.format_exc() + '\n\nYou probably put in an incorrect IP address in Settings')            
        wx.PostEvent(frame.main_tab, evt)

    app.MainLoop()


问题


面经


文章

微信
公众号

扫码关注公众号