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


Python wx.FileConfig方法代碼示例

本文整理匯總了Python中wx.FileConfig方法的典型用法代碼示例。如果您正苦於以下問題:Python wx.FileConfig方法的具體用法?Python wx.FileConfig怎麽用?Python wx.FileConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wx的用法示例。


在下文中一共展示了wx.FileConfig方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import FileConfig [as 別名]
def __init__(self, utility, system_default_locale = 'en_EN'):
        self.utility = utility
        default_filename = 'en_EN.lang'
        langpath = os.path.join(self.utility.getPath(), 'data', 'lang')
        sys.stdout.write('Setting up languages\n')
        sys.stdout.write('Default: ' + str(default_filename) + '\n')
        sys.stdout.write('System: ' + str(system_default_locale) + '\n')
        self.user_lang = None
        user_filepath = os.path.join(self.utility.getConfigPath(), 'user.lang')
        if existsAndIsReadable(user_filepath):
            self.user_lang = ConfigReader(user_filepath, 'ABC/language')
        parsed_locale = self.parse_locale(system_default_locale)
        self.local_lang_filename = parsed_locale + '.lang'
        self.local_lang = None
        local_filepath = os.path.join(langpath, self.local_lang_filename)
        if self.local_lang_filename != default_filename and existsAndIsReadable(local_filepath):
            if globalConfig.get_mode() == 'client_wx':
                import wx
                self.local_lang = wx.FileConfig(localFilename=local_filepath)
                self.local_lang.SetPath('ABC/language')
            else:
                self.local_lang = ConfigReader(local_filepath, 'ABC/language')
        self.default_lang = None
        default_filepath = os.path.join(langpath, default_filename)
        if existsAndIsReadable(default_filepath):
            self.default_lang = ConfigReader(default_filepath, 'ABC/language')
        self.cache = {}
        self.langwarning = False 
開發者ID:alesnav,項目名稱:p2ptv-pi,代碼行數:30,代碼來源:lang.py

示例2: CreateLocalConf

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import FileConfig [as 別名]
def CreateLocalConf(self, path):
        name = os.path.splitext(path)[0]
        name += '.xcfg'
        return wx.FileConfig(localFilename=name) 
開發者ID:andreas-p,項目名稱:admin4,代碼行數:6,代碼來源:xrced.py

示例3: load_from_ini

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import FileConfig [as 別名]
def load_from_ini(self):
        """Init from config file if it exists."""
        if not os.path.isfile(self.config_file):
            return
        f = FileConfig(localFilename=self.config_file)

        f.SetPath('/html_defaults')
        self.dark_mode = f.ReadBool('dark_mode', self.dark_mode)
        self.show_pads = f.ReadBool('show_pads', self.show_pads)
        self.show_fabrication = f.ReadBool(
                'show_fabrication', self.show_fabrication)
        self.show_silkscreen = f.ReadBool(
                'show_silkscreen', self.show_silkscreen)
        self.highlight_pin1 = f.ReadBool('highlight_pin1', self.highlight_pin1)
        self.redraw_on_drag = f.ReadBool('redraw_on_drag', self.redraw_on_drag)
        self.board_rotation = f.ReadInt('board_rotation', self.board_rotation)
        self.checkboxes = f.Read('checkboxes', self.checkboxes)
        self.bom_view = f.Read('bom_view', self.bom_view)
        self.layer_view = f.Read('layer_view', self.layer_view)
        self.open_browser = f.ReadBool('open_browser', self.open_browser)

        f.SetPath('/general')
        self.bom_dest_dir = f.Read('bom_dest_dir', self.bom_dest_dir)
        self.bom_name_format = f.Read('bom_name_format', self.bom_name_format)
        self.component_sort_order = self._split(f.Read(
                'component_sort_order',
                ','.join(self.component_sort_order)))
        self.component_blacklist = self._split(f.Read(
                'component_blacklist',
                ','.join(self.component_blacklist)))
        self.blacklist_virtual = f.ReadBool(
                'blacklist_virtual', self.blacklist_virtual)
        self.blacklist_empty_val = f.ReadBool(
                'blacklist_empty_val', self.blacklist_empty_val)
        self.include_tracks = f.ReadBool('include_tracks', self.include_tracks)
        self.include_nets = f.ReadBool('include_nets', self.include_nets)

        f.SetPath('/extra_fields')
        self.extra_fields = self._split(f.Read(
                'extra_fields',
                self._join(self.extra_fields)))
        self.normalize_field_case = f.ReadBool(
                'normalize_field_case', self.normalize_field_case)
        self.board_variant_field = f.Read(
                'board_variant_field', self.board_variant_field)
        self.board_variant_whitelist = self._split(f.Read(
                'board_variant_whitelist',
                ','.join(self.board_variant_whitelist)))
        self.board_variant_blacklist = self._split(f.Read(
                'board_variant_blacklist',
                ','.join(self.board_variant_blacklist)))
        self.dnp_field = f.Read('dnp_field', self.dnp_field) 
開發者ID:openscopeproject,項目名稱:InteractiveHtmlBom,代碼行數:54,代碼來源:config.py

示例4: save

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import FileConfig [as 別名]
def save(self):
        f = FileConfig(localFilename=self.config_file)

        f.SetPath('/html_defaults')
        f.WriteBool('dark_mode', self.dark_mode)
        f.WriteBool('show_pads', self.show_pads)
        f.WriteBool('show_fabrication', self.show_fabrication)
        f.WriteBool('show_silkscreen', self.show_silkscreen)
        f.WriteBool('highlight_pin1', self.highlight_pin1)
        f.WriteBool('redraw_on_drag', self.redraw_on_drag)
        f.WriteInt('board_rotation', self.board_rotation)
        f.Write('checkboxes', self.checkboxes)
        f.Write('bom_view', self.bom_view)
        f.Write('layer_view', self.layer_view)
        f.WriteBool('open_browser', self.open_browser)

        f.SetPath('/general')
        bom_dest_dir = self.bom_dest_dir
        if bom_dest_dir.startswith(self.netlist_initial_directory):
            bom_dest_dir = os.path.relpath(
                    bom_dest_dir, self.netlist_initial_directory)
        f.Write('bom_dest_dir', bom_dest_dir)
        f.Write('bom_name_format', self.bom_name_format)
        f.Write('component_sort_order',
                ','.join(self.component_sort_order))
        f.Write('component_blacklist',
                ','.join(self.component_blacklist))
        f.WriteBool('blacklist_virtual', self.blacklist_virtual)
        f.WriteBool('blacklist_empty_val', self.blacklist_empty_val)
        f.WriteBool('include_tracks', self.include_tracks)
        f.WriteBool('include_nets', self.include_nets)

        f.SetPath('/extra_fields')
        f.Write('extra_fields', self._join(self.extra_fields))
        f.WriteBool('normalize_field_case', self.normalize_field_case)
        f.Write('board_variant_field', self.board_variant_field)
        f.Write('board_variant_whitelist',
                ','.join(self.board_variant_whitelist))
        f.Write('board_variant_blacklist',
                ','.join(self.board_variant_blacklist))
        f.Write('dnp_field', self.dnp_field)
        f.Flush() 
開發者ID:openscopeproject,項目名稱:InteractiveHtmlBom,代碼行數:44,代碼來源:config.py


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