本文整理汇总了Python中save.get_save_dir函数的典型用法代码示例。如果您正苦于以下问题:Python get_save_dir函数的具体用法?Python get_save_dir怎么用?Python get_save_dir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_save_dir函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: main
def main(size=None, init=True):
features.FEATURE_FILE_PATH = os.path.join(save.get_save_dir(), 'features')
features.parse_options()
setup_game_version()
setup_android_version()
setup_errors()
size = size or check_force_size()
maybe_start_remote_debug()
monitor.start()
client.window.init_screen(size)
osutil.init()
ui.init()
ui.set_fill_image(None)
unpack_data()
ui.set_fill_image(pygame.image.load('data/user/background.jpg'))
setup_freeciv_config()
client.window.init()
gamescreen.init()
start_autoupdate()
if init:
client.freeciv.run()
else:
client_main()
开发者ID:gcgrant,项目名称:freeciv-android,代码行数:30,代码来源:main.py
示例2: main
def main():
features.FEATURE_FILE_PATH = os.path.join(save.get_save_dir(), 'features')
features.parse_options()
setup_game_version()
setup_android_version()
setup_errors()
maybe_start_remote_debug()
monitor.start()
save.start_zygote()
client.window.init_screen()
osutil.init()
ui.init()
ui.set_fill_image(graphics.load_image('data/user/background.jpg'))
setup_freeciv_config()
client.window.init()
gamescreen.init()
start_autoupdate()
start_marketnotice()
client.freeciv.run()
开发者ID:bbqchickenrobot,项目名称:freeciv-android,代码行数:26,代码来源:main.py
示例3: setup_freeciv_config
def setup_freeciv_config():
path = os.environ['FREECIV_OPT'] = save.get_save_dir() + '/civrc-2.3-1'
try:
if not os.path.exists(path):
shutil.copy('data/civrc-2.3-default', path)
except (IOError, OSError):
pass
开发者ID:at13,项目名称:freeciv-android,代码行数:7,代码来源:main.py
示例4: get_resume_data
def get_resume_data():
try:
content = open(pause_file).read()
except IOError:
return None
else:
return os.path.join(save.get_save_dir(), 'pause_save.sav.gz')
开发者ID:renatolouro,项目名称:freeciv-android,代码行数:7,代码来源:main.py
示例5: comment_upload
def comment_upload(install_time):
ui.execute_later(lambda: ui.message('Compressing log...'))
content = lzma.compress(open(save.get_save_dir() + '/more.log').read())
ui.execute_later(lambda: ui.back())
request(lambda result: comment_next(install_time), 'upload_log', content, install_time,
banner="Uploading log (%dkB)" % (len(content)/1024))
开发者ID:bbqchickenrobot,项目名称:freeciv-android,代码行数:9,代码来源:sync.py
示例6: get_install_time
def get_install_time():
path = os.path.join(save.get_save_dir(), 'install_time')
try:
return int(open(path).read())
except (IOError, ValueError):
install_time = int(time.time() * 1000)
with open(path, 'w') as f:
f.write('%d' % install_time)
return install_time
开发者ID:turbo-codes,项目名称:freeciv-android,代码行数:9,代码来源:sync.py
示例7: client
def client():
global session
if not session:
try:
sessid = open(save.get_save_dir() + '/civsync.sessid.txt').read().strip()
except IOError:
sessid = None
session = civsync.Session(sessid)
return session
开发者ID:MegaMark16,项目名称:freeciv-android,代码行数:11,代码来源:sync.py
示例8: downloaded
def downloaded(data):
ui.set_dialog(ui.Label('Loading save...'))
uncompressed = lzma.decompress(data)
print 'Uncompressed size', len(uncompressed)
dl_path = save.get_save_dir() + '/downloaded_save'
try:
os.remove(dl_path)
except OSError:
print 'not removed...'
with open(dl_path, 'wb') as f:
f.write(uncompressed)
ui.back(anim=False)
save.load_game(dl_path)
开发者ID:MegaMark16,项目名称:freeciv-android,代码行数:13,代码来源:sync.py
示例9: save_and_sync_next_step
def save_and_sync_next_step(old_set):
name_set = None
start_time = time.time()
stop = False
while not stop:
print 'finding save...'
dir = save.get_save_dir()
listing = list_saves(dir)
new_set = set(listing)
name_set = new_set - old_set
if not name_set:
for name in listing:
mtime = os.path.getmtime(os.path.join(dir, name))
if mtime > start_time:
stop = True
break
time.sleep(0.5)
else:
stop = True
name = iter(name_set).next()
break
print 'found save', name
time.sleep(0.5)
ui.execute_later.append(lambda: upload_save(save.get_save_dir() + '/' + name, name))
开发者ID:MegaMark16,项目名称:freeciv-android,代码行数:24,代码来源:sync.py
示例10: comment_upload
def comment_upload(install_time):
with ui.execute_later_lock:
ui.execute_later.append(lambda: ui.message("Compressing log..."))
content = lzma.compress(open(save.get_save_dir() + "/more.log").read())
with ui.execute_later_lock:
ui.execute_later.append(lambda: ui.back())
request(
lambda result: comment_next(install_time),
"upload_log",
content,
install_time,
banner="Uploading log (%dkB)" % (len(content) / 1024),
)
开发者ID:renatolouro,项目名称:freeciv-android,代码行数:16,代码来源:sync.py
示例11: pause
def pause():
if client.client:
print 'pause occured'
print 'saving game'
client.client.chat('/save %s/pause_save.sav.gz' % save.get_save_dir())
with open(pause_file, 'w') as f:
f.write('version=1\n')
time.sleep(featues.get('app.shutdown'))
if not osutil.is_paused():
remove_pause_file()
return
print 'turning off server'
client.client.disconnect()
ui.back(allow_override=False)
osutil.wait_for_resume()
resume()
else:
osutil.wait_for_resume()
开发者ID:renatolouro,项目名称:freeciv-android,代码行数:18,代码来源:main.py
示例12: pause
def pause():
if client.client:
print "pause occured"
print "saving game"
client.client.chat("/save %s/pause_save.sav.gz" % save.get_save_dir())
with open(pause_file, "w") as f:
f.write("version=1\n")
time.sleep(features.get("app.shutdown"))
if not osutil.is_paused():
remove_pause_file()
return
print "turning off server"
client.client.disconnect()
ui.back(allow_override=False)
osutil.wait_for_resume()
resume()
else:
osutil.wait_for_resume()
开发者ID:joglomedia,项目名称:freeciv-android,代码行数:18,代码来源:main.py
示例13: save_and_sync
def save_and_sync(client):
old_set = set(list_saves(save.get_save_dir()))
client.chat('/save')
ui.back()
threading.Thread(target=save_and_sync_next_step, args=(old_set, )).start()
开发者ID:MegaMark16,项目名称:freeciv-android,代码行数:5,代码来源:sync.py
示例14: apply_hardexit
features.add_feature('app.autoupdate', default=True, type=bool)
features.add_feature('app.forcesize')
features.add_feature('app.resume', default=True, type=bool)
features.add_feature('app.profile', default=False, type=bool)
features.add_feature('app.shutdown', default=10, type=int)
features.add_feature('app.multiplayer', default=False, type=bool)
def apply_hardexit(t):
client.freeciv.hard_exit = t
features.set_applier('app.hardexit', apply_hardexit, type=bool, default=True)
main_menu = None
main_menu_update_shown = False
pause_file = os.path.join(save.get_save_dir(), 'pause_options')
def client_main():
action = sys.argv[1] if sys.argv[1:] else None
if try_resume():
ui.main()
return
if action == 'load':
savename = sys.argv[2]
save.load_game(savename)
elif action == 'connect':
host, port = sys.argv[2:]
save.connect(host, int(port))
else:
show_main_menu()
开发者ID:renatolouro,项目名称:freeciv-android,代码行数:31,代码来源:main.py
示例15: get_download_path
def get_download_path():
return _save.get_save_dir() + '/from-dropbox.sav'
开发者ID:ashishmishra007,项目名称:freeciv-android,代码行数:2,代码来源:dropbox.py
示例16: logged
def logged(result):
print 'Login successful'
with open(save.get_save_dir() + '/civsync.sessid.txt', 'w') as f:
f.write(session.sessid)
callback()
开发者ID:MegaMark16,项目名称:freeciv-android,代码行数:5,代码来源:sync.py
示例17: logged
def logged(result):
print "Login successful"
with open(save.get_save_dir() + "/civsync.sessid.txt", "w") as f:
f.write(session.sessid)
ui.back(anim=False)
callback()
开发者ID:renatolouro,项目名称:freeciv-android,代码行数:6,代码来源:sync.py
注:本文中的save.get_save_dir函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论