本文整理汇总了Python中mamewah_ini.MameWahIni.has_option方法的典型用法代码示例。如果您正苦于以下问题:Python MameWahIni.has_option方法的具体用法?Python MameWahIni.has_option怎么用?Python MameWahIni.has_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mamewah_ini.MameWahIni
的用法示例。
在下文中一共展示了MameWahIni.has_option方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from mamewah_ini import MameWahIni [as 别名]
# 或者: from mamewah_ini.MameWahIni import has_option [as 别名]
def __init__(self, glade_filename, window_name, WinSetup):
"""build the dialog"""
GladeSupport.__init__(self, glade_filename, window_name, APP_NAME)
self.dlgAddEmu.set_transient_for(WinSetup.winSetup)
self.dlgAddEmu.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
#winsetup class
self.WinSetup = WinSetup
#create new emulator list
self.tvw, self.ls, self.tvws = self.setup_treeview(
columns = [_('Select an Emulator Template...')],
column_types = [gobject.TYPE_STRING, gobject.TYPE_STRING,
gobject.TYPE_STRING],
container = self.scw,
resizeable_cols = False)
#get list of available templates
emu_ini_files = glob.glob(os.path.join(APP_PATH, 'templates', '*.ini'))
for emu_ini in emu_ini_files:
ini = MameWahIni(emu_ini)
if not ini.has_option('list_title'):
basename = os.path.splitext(os.path.basename(emu_ini))[0]
self.ls.append(
('%s (%s)' % (ini.get('emulator_title'), basename),
basename,
emu_ini))
#set dialog size
num = len(self.ls)
if num > 10:
num = 10
self.dlgAddEmu.set_size_request(320, 120 + (num * 15))
#sort
self.ls.set_sort_column_id(0, gtk.SORT_ASCENDING)
示例2: buildemulist
# 需要导入模块: from mamewah_ini import MameWahIni [as 别名]
# 或者: from mamewah_ini.MameWahIni import has_option [as 别名]
def buildemulist(self):
emu_lists = []
emu_ini_files = self.build_filelist("", "ini", "(.*(?<!=-))")
for emu_ini in emu_ini_files:
ini = MameWahIni(emu_ini)
if not ini.has_option('list_title'):
emu_lists.append(
[ini.get('emulator_title'),
os.path.splitext(os.path.basename(emu_ini))[0],ini])
return emu_lists
示例3: load_settings
# 需要导入模块: from mamewah_ini import MameWahIni [as 别名]
# 或者: from mamewah_ini.MameWahIni import has_option [as 别名]
def load_settings(self, default_emu=None):
"""load wahcade settings"""
#build list of emulators
self.emu_lists = []
self.emu_game_lists = []
self.current_emu = None
self.current_emu_list = None
emu_ini_files = glob.glob(os.path.join(self.config_dir, 'ini', '*.ini'))
for emu_ini in emu_ini_files:
ini = MameWahIni(emu_ini)
if not ini.has_option('list_title'):
self.emu_lists.append(
[ini.get('emulator_title'),
os.path.splitext(os.path.basename(emu_ini))[0],
ini])
self.emu_lists.sort()
#load emu combo
l = ['%s (%s.ini)' % (e[0], e[1]) for e in self.emu_lists]
self.setup_combo_box(self.cboEmu, l)
#wahcade
self.txeWCLayoutDir.set_text(self.wahcade_ini.get('layout'))
self.chkWCFullscreen.set_active((self.wahcade_ini.getint('fullscreen', 0) == 1))
self.spnWCScrDelay.set_value(self.wahcade_ini.getint('delay'))
self.spnWCScrSlide.set_value(self.wahcade_ini.getint('slide_duration'))
self.spnWCMovieDelay.set_value(self.wahcade_ini.getint('delay_before_movie_preview'))
self.hscWCMovieVolume.set_value(self.wahcade_ini.getint('movie_volume'))
ini_mix = self.wahcade_ini.get('music_movie_mix')
mix_idx = [idx for idx, r in enumerate(self.music_movie_mix) if r[0] == ini_mix][0]
self.cboWCMovieMix.set_active(mix_idx)
self.txeWCMovieIntro.set_text(self.wahcade_ini.get('intro_movie_file'))
self.txeWCMovieExit.set_text(self.wahcade_ini.get('exit_movie_file'))
self.txeWCMusicDir.set_text(self.wahcade_ini.get('music_path'))
self.chkWCMusic.set_active((self.wahcade_ini.getint('enable_music', 0) == 1))
self.hscWCMusicVolume.set_value(self.wahcade_ini.getint('music_volume'))
self.chkWCMusicShuffle.set_active((self.wahcade_ini.getint('shuffle_music', 0) == 1))
self.chkWCMouseCursor.set_active((self.wahcade_ini.getint('show_cursor') == 1))
self.chkWCWrapLists.set_active((self.wahcade_ini.getint('wrap_list') == 1))
self.chkWCScaleImages.set_active((self.wahcade_ini.getint('keep_image_aspect') == 1))
self.chkWCListArrows.set_active((self.wahcade_ini.getint('show_list_arrows', 0) == 1))
#set emu
set_idx = 0
if default_emu:
set_idx = [idx for idx, e in enumerate(self.emu_lists) if e[1] == default_emu][0]
self.cboEmu.set_active(set_idx)
#mame history viewer
self.txeHstDatFile.set_text(self.histview_ini.get('history_dat_file'))
self.txeHstLayout.set_text(self.histview_ini.get('history_layout'))
#mame cp viewer
self.txeCPVIni.set_text(self.cpviewer_ini.get('controls_ini_file'))
self.txeCPVLayout.set_text(self.cpviewer_ini.get('viewer_layout'))
#load keys
self.chkKeysUseKeyboard.set_active((self.ctrlr_ini.getint('keyboard') == 1))
self.chkKeysUseMouse.set_active((self.ctrlr_ini.getint('mouse') == 1))
self.chkKeysUseJoystick.set_active((self.ctrlr_ini.getint('joystick') == 1))
self.populate_keys()