本文整理汇总了Python中VFS.rename方法的典型用法代码示例。如果您正苦于以下问题:Python VFS.rename方法的具体用法?Python VFS.rename怎么用?Python VFS.rename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VFS
的用法示例。
在下文中一共展示了VFS.rename方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updatePlayer
# 需要导入模块: import VFS [as 别名]
# 或者: from VFS import rename [as 别名]
def updatePlayer(player, pref):
a = _playerDB.execute('SELECT * FROM `players` WHERE `name` = ?', [player]).fetchone()
try:
a = a[0]
except:
a = None
if a is not None:
_playerDB.execute('UPDATE `players` SET `name` = ?, `lefty` = ?, `drumflip` = ?, `autokick` = ?, `assist` = ?, `twochord` = ?, `necktype` = ?, `neck` = ?, \
`part` = 0, `difficulty` = 2, `upname` = ?, `control` = 0, `changed` = 1, `loaded` = 1 WHERE `name` = ?', pref + [player])
if player != pref[0]:
VFS.rename(_makePlayerIniName(player), _makePlayerIniName(pref[0]))
else:
_playerDB.execute('INSERT INTO `players` VALUES (?, ?, ?, ?, ?, ?, ?, ?, 0, 2, ?, 0, 1, 1)', pref)
_playerDB.commit()
savePlayers()
loadPlayers()
示例2: renameControl
# 需要导入模块: import VFS [as 别名]
# 或者: from VFS import rename [as 别名]
def renameControl(control, newname):
VFS.rename(_makeControllerIniName(control), _makeControllerIniName(newname))
for i in range(4):
if Config.get("game", "control%d" % i) == control:
Config.set("game", "control%d" % i, newname)
loadControls()
示例3: rename
# 需要导入模块: import VFS [as 别名]
# 或者: from VFS import rename [as 别名]
def rename(self, src, dest):
VFS.rename(src, dest)