本文整理汇总了Python中fsgs.FSGSDirectories.FSGSDirectories.get_base_dir方法的典型用法代码示例。如果您正苦于以下问题:Python FSGSDirectories.get_base_dir方法的具体用法?Python FSGSDirectories.get_base_dir怎么用?Python FSGSDirectories.get_base_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fsgs.FSGSDirectories.FSGSDirectories
的用法示例。
在下文中一共展示了FSGSDirectories.get_base_dir方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_base_dir [as 别名]
def __init__(self, parent):
super().__init__(parent)
icon = fsui.Icon("settings", "pkg:workspace")
# gettext("WHDLoad Settings")
title = gettext("WHDLoad")
subtitle = gettext("Options for WHDLoad support in FS-UAE Launcher")
self.add_header(icon, title, subtitle)
label = fsui.MultiLineLabel(self, gettext(
"The following options only apply when you use the automatic "
"WHDLoad support in FS-UAE Launcher, for example in relation with "
"the online game database."), 640)
self.layout.add(label, fill=True, margin_top=0)
self.add_option("whdload_splash_delay")
label = fsui.Label(
self, gettext("Directory for WHDLoad.key file (if you have it):"))
self.layout.add(label, margin_top=10)
hor_layout = fsui.HorizontalLayout()
self.layout.add(hor_layout, margin_top=4, fill=True)
label = fsui.Label(
self, FSGSDirectories.get_base_dir())
hor_layout.add_spacer(0, expand=True)
hor_layout.add(label)
示例2: find_font_path_or_stream
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_base_dir [as 别名]
def find_font_path_or_stream(name):
path = os.path.join(
FSGSDirectories.get_base_dir(), "Workspace", "Fonts", name)
if os.path.exists(path):
return path
stream = resources.resource_stream(name)
return stream
示例3: app_main
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_base_dir [as 别名]
def app_main():
FSGSDirectories.initialize()
Settings.instance().load()
print("")
print("Directories:")
print("* base_dir =", FSGSDirectories.get_base_dir())
print("* cache_dir =", FSGSDirectories.get_cache_dir())
print("* cdroms_dir =", FSGSDirectories.get_cdroms_dir())
print("* configurations_dir =", FSGSDirectories.get_configurations_dir())
print("* controllers_dir =", FSGSDirectories.get_controllers_dir())
print("* covers_dir =", FSGSDirectories.get_covers_dir())
print("* data_dir =", FSGSDirectories.get_data_dir())
print("* downloads_dir =", FSGSDirectories.downloads_dir())
print("* floppies_dir =", FSGSDirectories.get_floppies_dir())
print("* hard_drives_dir =", FSGSDirectories.get_hard_drives_dir())
# print("* images_dir =", FSGSDirectories.get_images_dir())
print("* kickstarts_dir =", FSGSDirectories.get_kickstarts_dir())
print("* launcher_dir =", FSGSDirectories.get_launcher_dir())
print("* logs_dir =", FSGSDirectories.get_logs_dir())
print("* plugins_dir =", FSGSDirectories.get_plugins_dir())
# print("* portable_dir =", FSGSDirectories.portable_dir())
print("* save_states_dir =", FSGSDirectories.get_save_states_dir())
print("* screenshots_dir =", FSGSDirectories.get_screenshots_dir())
print("* screenshots_output_dir =", FSGSDirectories.screenshots_output_dir())
print("* themes_dir =", FSGSDirectories.get_themes_dir())
print("* titles_dir =", FSGSDirectories.get_titles_dir())
print("* whdload_dir =", FSGSDirectories.get_whdload_dir())
print("")
示例4: decode_path
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_base_dir [as 别名]
def decode_path(self, path):
if not path or path[0] != "$":
return path
base_dir = FSGSDirectories.get_base_dir() + "/"
if path.startswith("$/"):
path = base_dir + path[2:]
return path
示例5: plugin_path
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_base_dir [as 别名]
def plugin_path(cls):
result = []
plugins_dir = FSGSDirectories.get_plugins_dir()
if plugins_dir and os.path.isdir(plugins_dir):
result.append(plugins_dir)
expansion_dir = os.path.join(
FSGSDirectories.get_base_dir(), "Workspace", "Expansion"
)
if expansion_dir and os.path.isdir(expansion_dir):
result.append(expansion_dir)
if System.macos:
system_plugins_dir = os.path.join(
fsboot.executable_dir(),
"..",
"..",
"..",
"..",
"..",
"..",
"Plugins",
)
else:
system_plugins_dir = os.path.join(
fsboot.executable_dir(), "..", "..", "..", "Plugins"
)
if os.path.isdir(system_plugins_dir):
result.append(system_plugins_dir)
return result
示例6: plugin_path
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_base_dir [as 别名]
def plugin_path(cls):
result = []
plugins_dir = FSGSDirectories.get_plugins_dir()
if plugins_dir and os.path.isdir(plugins_dir):
result.append(plugins_dir)
expansion_dir = os.path.join(
FSGSDirectories.get_base_dir(), "Workspace", "Expansion")
if expansion_dir and os.path.isdir(expansion_dir):
result.append(expansion_dir)
return result
示例7: encode_path
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_base_dir [as 别名]
def encode_path(self, path):
# This only works if both path and FSGSDirectories.base_dir (etc) have
# been normalized with get_real_case.
path = path.replace("\\", "/")
base_dir = FSGSDirectories.get_base_dir()
if path.startswith(base_dir):
path = path[len(base_dir):]
if path.startswith("/"):
path = path[1:]
path = "$/" + path
return path
示例8: get_default_directory
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_base_dir [as 别名]
def get_default_directory(media_type):
if media_type == "floppy":
return FSGSDirectories.get_floppies_dir()
elif media_type == "cd":
return FSGSDirectories.get_cdroms_dir()
elif media_type == "hd":
return FSGSDirectories.get_hard_drives_dir()
elif media_type == "rom":
return FSGSDirectories.get_kickstarts_dir()
# FIXME: Return new Media directory instead
return FSGSDirectories.get_base_dir()
示例9: get_settings_path
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_base_dir [as 别名]
def get_settings_path(self):
settings_ini = os.path.join(FSGSDirectories.get_data_dir(),
"Settings.ini")
if not os.path.exists(settings_ini):
migrate_list = [os.path.join(FSGSDirectories.get_data_dir(),
"FS-UAE Launcher.ini")]
portable_ini = os.path.join(FSGSDirectories.get_base_dir(),
"Portable.ini")
if not os.path.exists(portable_ini):
# not portable, can migrate settings from old
# launcher.settings file
migrate_list.append(os.path.join(
get_data_dir(), "fs-uae", "launcher.settings"))
# move the highest-priority settings file if present
for migrate in migrate_list:
if os.path.exists(migrate):
shutil.move(migrate, settings_ini)
break
# remove all old settings files
for migrate in migrate_list:
if os.path.exists(migrate):
os.remove(migrate)
return settings_ini
示例10: get_base_dir
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_base_dir [as 别名]
def get_base_dir(self):
# FIXME: dependency loop
return FSGSDirectories.get_base_dir()
示例11: prepare_config
# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_base_dir [as 别名]
def prepare_config(cls, original_config):
config = defaultdict(str)
for key, value in LauncherSettings.items():
# We now show warnings on status bar instead
# if key in LauncherConfig.config_keys:
# print("... ignoring config key from settings:", key)
# continue
config[key] = value
config["base_dir"] = FSGSDirectories.get_base_dir()
for key, value in original_config.items():
if value:
config[key] = value
if not config["joystick_port_0_mode"]:
config["joystick_port_0_mode"] = "mouse"
if not config["joystick_port_1_mode"]:
if config["amiga_model"].startswith("CD32"):
config["joystick_port_1_mode"] = "cd32 gamepad"
else:
config["joystick_port_1_mode"] = "joystick"
if not config["joystick_port_2_mode"]:
config["joystick_port_2_mode"] = "none"
if not config["joystick_port_3_mode"]:
config["joystick_port_3_mode"] = "none"
from .device_manager import DeviceManager
devices = DeviceManager.get_devices_for_ports(config)
for port in range(4):
key = "joystick_port_{0}".format(port)
if not config.get(key):
# key not set, use calculated default value
config[key] = devices[port].id
for remove_key in ["database_username", "database_password",
"database_username", "database_email",
"database_auth", "device_id"]:
if remove_key in config:
del config[remove_key]
# overwrite netplay config
if config.get("__netplay_host", ""):
config["netplay_server"] = config["__netplay_host"]
if config.get("__netplay_password", ""):
config["netplay_password"] = config["__netplay_password"]
if config.get("__netplay_port", ""):
config["netplay_port"] = config["__netplay_port"]
# copy actual kickstart options from x_ options
config["kickstart_file"] = config["x_kickstart_file"]
config["kickstart_ext_file"] = config["x_kickstart_ext_file"]
if not config["kickstart_file"]:
# Warning will have been shown on the status bar
config["kickstart_file"] = "internal"
# Copy default configuration values from model defaults. The main
# purpose of this is to let the launch code know about implied defaults
# so it can for example configure correct ROM files for expansions.
model_config = Amiga.get_current_config(config)
for key, value in model_config["defaults"].items():
if not config.get(key):
config[key] = value
# make sure FS-UAE does not load other config files (Host.fs-uae)
config["end_config"] = "1"
# Make FS-UAE check that version matches (except for development)
if VERSION != "9.8.7dummy":
config[Option.EXPECT_VERSION] = VERSION
if config.get("__netplay_game", ""):
print("\nfixing config for netplay game")
for key in [x for x in config.keys() if x.startswith("uae_")]:
print("* removing option", key)
del config[key]
return config