本文整理汇总了Python中fofix.core.VFS.resolveRead方法的典型用法代码示例。如果您正苦于以下问题:Python VFS.resolveRead方法的具体用法?Python VFS.resolveRead怎么用?Python VFS.resolveRead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fofix.core.VFS
的用法示例。
在下文中一共展示了VFS.resolveRead方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadPlayers
# 需要导入模块: from fofix.core import VFS [as 别名]
# 或者: from fofix.core.VFS import resolveRead [as 别名]
def loadPlayers():
global playername, playerpref, playerstat
playername = []
playerpref = []
playerstat = []
allplayers = VFS.listdir(playerpath)
for name in allplayers:
if name == "default.ini":
continue
if name.lower().endswith(".ini") and len(name) > 4:
playername.append(name[0:len(name)-4])
pref = _playerDB.execute('SELECT * FROM `players` WHERE `name` = ?', [playername[-1]]).fetchone()
try:
if len(pref) == 14:
playerpref.append((pref[1], pref[2], pref[3], pref[4], pref[5], pref[6], pref[7], pref[8], pref[9], pref[10]))
except TypeError:
try:
c = Config.load(VFS.resolveRead(_makePlayerIniName(name[:-4])), type = 2)
lefty = c.get("player","leftymode")
drumf = c.get("player","drumflip")
autok = c.get("player","auto_kick")
assist = c.get("player","assist_mode")
twoch = c.get("player","two_chord_max")
neck = c.get("player","neck")
neckt = c.get("player","necktype")
part = c.get("player","part")
diff = c.get("player","difficulty")
upname = c.get("player","name")
control= c.get("player","controller")
del c
_playerDB.execute('INSERT INTO `players` VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, 1)', [playername[-1], lefty, drumf, autok, assist, twoch, neckt, neck, part, diff, upname, control])
playerpref.append((lefty, drumf, autok, assist, twoch, neckt, neck, part, diff, upname))
except IOError:
_playerDB.execute('INSERT INTO `players` VALUES (?, 0, 0, 0, 0, 0, 0, ``, 0, 2, ``, 0, 0, 1)', [playername[-1]])
playerpref.append((0, 0, 0, 0, 0, 0, '', 0, 2, '', 0))
_playerDB.execute('UPDATE `players` SET `loaded` = 1 WHERE `name` = ?', [playername[-1]])
_playerDB.commit()
return 1
示例2: __init__
# 需要导入模块: from fofix.core import VFS [as 别名]
# 或者: from fofix.core.VFS import resolveRead [as 别名]
def __init__(self):
self.logClassInits = Config.get("game", "log_class_inits")
if self.logClassInits == 1:
log.debug("Controls class init (Player.py)...")
self.controls = []
self.controls.append(Config.get("game", "control0"))
self.controls.append(Config.get("game", "control1"))
self.controls.append(Config.get("game", "control2"))
self.controls.append(Config.get("game", "control3"))
self.config = []
self.controlList = []
self.maxplayers = 0
self.guitars = 0
self.drums = 0
self.mics = 0
self.overlap = []
self.p2Nav = Config.get("game", "p2_menu_nav")
self.drumNav = Config.get("game", "drum_navigation")
self.keyCheckerMode = Config.get("game","key_checker_mode")
if VFS.isfile(_makeControllerIniName(self.controls[0])):
self.config.append(Config.load(VFS.resolveRead(_makeControllerIniName(self.controls[0])), type = 1))
if VFS.isfile(_makeControllerIniName(self.controls[1])) and self.controls[1] != "None":
self.config.append(Config.load(VFS.resolveRead(_makeControllerIniName(self.controls[1])), type = 1))
else:
self.config.append(None)
Config.set("game", "control1", None)
self.controls[1] = "None"
if VFS.isfile(_makeControllerIniName(self.controls[2])) and self.controls[2] != "None":
self.config.append(Config.load(VFS.resolveRead(_makeControllerIniName(self.controls[2])), type = 1))
else:
self.config.append(None)
Config.set("game", "control2", None)
self.controls[2] = "None"
if VFS.isfile(_makeControllerIniName(self.controls[3])) and self.controls[3] != "None":
self.config.append(Config.load(VFS.resolveRead(_makeControllerIniName(self.controls[3])), type = 1))
else:
self.config.append(None)
Config.set("game", "control3", None)
self.controls[3] = "None"
else:
confM = None
if Microphone.supported:
confM = Config.load(VFS.resolveRead(_makeControllerIniName("defaultm")), type = 1)
self.config.append(Config.load(VFS.resolveRead(_makeControllerIniName("defaultg")), type = 1))
self.config.append(Config.load(VFS.resolveRead(_makeControllerIniName("defaultd")), type = 1))
self.config.append(confM)
self.config.append(None)
Config.set("game", "control0", "defaultg")
Config.set("game", "control1", "defaultd")
self.controls = ["defaultg", "defaultd"]
if confM is not None:
Config.set("game", "control2", "defaultm")
self.controls.append("defaultm")
else:
Config.set("game", "control2", None)
self.controls.append("None")
Config.set("game", "control3", None)
self.controls.append("None")
self.type = []
self.analogKill = []
self.analogSP = []
self.analogSPThresh = []
self.analogSPSense = []
self.analogDrum = [] #FIXME: Analog Drum
self.analogSlide = []
self.analogFX = [] #FIXME: Analog FX
self.twoChord = []
self.micDevice = [] #stump
self.micTapSensitivity = []
self.micPassthroughVolume = []
self.flags = 0
for i in self.config:
if i:
type = i.get("controller", "type")
if type == 5:
self.mics += 1
elif type > 1:
self.guitars += 1
else:
self.drums += 1
self.type.append(type)
self.analogKill.append(i.get("controller", "analog_kill"))
self.analogSP.append(i.get("controller", "analog_sp"))
self.analogSPThresh.append(i.get("controller", "analog_sp_threshold"))
self.analogSPSense.append(i.get("controller", "analog_sp_sensitivity"))
self.analogDrum.append(i.get("controller", "analog_drum")) #FIXME: Analog Drum
self.analogSlide.append(i.get("controller", "analog_slide"))
self.analogFX.append(i.get("controller", "analog_fx")) #FIXME: Analog FX
self.micDevice.append(i.get("controller", "mic_device")) #stump
self.micTapSensitivity.append(i.get("controller", "mic_tap_sensitivity"))
self.micPassthroughVolume.append(i.get("controller", "mic_passthrough_volume"))
self.twoChord.append(i.get("controller", "two_chord_max"))
self.controlList.append(i.get("controller", "name"))
#.........这里部分代码省略.........
示例3: _
# 需要导入模块: from fofix.core import VFS [as 别名]
# 或者: from fofix.core.VFS import resolveRead [as 别名]
Config.define("controller", "mic_passthrough_volume", float, 0.0, text = _("Passthrough Volume"), options=dict((n / 100.0, n) for n in range(101)), tipText = _("Sets how loud you hear yourself singing.")) #stump
Config.define("player", "name", str, "")
Config.define("player", "difficulty", int, Song.MED_DIF)
Config.define("player", "part", int, Song.GUITAR_PART)
Config.define("player", "neck", str, "")
Config.define("player", "necktype", str, 2, text = _("Neck Type"), options = {0: _("Default Neck"), 1: _("Theme Neck"), 2: _("Specific Neck")})
Config.define("player", "leftymode", int, 0, text = _("Lefty Mode"), options = {0: _("Off"), 1: _("On")})
Config.define("player", "drumflip", int, 0, text = _("Drum Flip"), options = {0: _("Off"), 1: _("On")})
Config.define("player", "two_chord_max", int, 0, text = _("Two-Chord Max"), options = {0: _("Off"), 1: _("On")})
Config.define("player", "assist_mode", int, 0, text = _("Assist Mode"), options = {0: _("Off"), 1: _("Easy Assist"), 2: _("Medium Assist")})
Config.define("player", "auto_kick", int, 0, text = _("Auto Kick"), options = {0: _("Off"), 1: _("On")})
Config.define("player", "controller", int, 0)
# Overlay the users folder in /data with one in the user data folder.
VFS.mount(VFS.resolveRead('/data/users'), 'users')
VFS.mountWritable(VFS.resolveWrite('/userdata/users'), 'users')
controlpath = '/users/controllers'
playerpath = '/users/players'
def _makeControllerIniName(name):
'''Turn a controller name into a virtual path to the appropriate ini.'''
return '%s/%s.ini' % (controlpath, name)
def _makePlayerIniName(name):
'''Turn a player name into a virtual path to the appropriate ini.'''
return '%s/%s.ini' % (playerpath, name)
control0 = None
control1 = None