当前位置: 首页>>代码示例>>Python>>正文


Python Paths.get_real_case方法代码示例

本文整理汇总了Python中fsbc.paths.Paths.get_real_case方法的典型用法代码示例。如果您正苦于以下问题:Python Paths.get_real_case方法的具体用法?Python Paths.get_real_case怎么用?Python Paths.get_real_case使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fsbc.paths.Paths的用法示例。


在下文中一共展示了Paths.get_real_case方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_whdload_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_whdload_dir(cls):
     cls._initialize()
     path = os.path.join(cls.get_hard_drives_dir(), "WHDLoad")
     if os.path.exists(path):
         path = Paths.get_real_case(path)
         return path
     return None
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:9,代码来源:FSGSDirectories.py

示例2: get_kickstarts_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_kickstarts_dir(cls):
     path = cls.portable_dir("kickstarts_dir")
     if not path:
         path = os.path.join(cls.get_base_dir(), "Kickstarts")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:10,代码来源:FSGSDirectories.py

示例3: get_controllers_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_controllers_dir(cls):
     path = cls.portable_dir("controllers_dir")
     if not path:
         path = os.path.join(cls.get_base_dir(), "Controllers")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:10,代码来源:FSGSDirectories.py

示例4: get_data_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_data_dir(cls):
     path = cls.portable_dir("data_dir")
     if not path:
         path = os.path.join(cls.get_base_dir(), "Data")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:10,代码来源:FSGSDirectories.py

示例5: get_save_states_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_save_states_dir(cls):
     path = cls.portable_dir("save_states_dir")
     if not path:
         path = os.path.join(cls.get_base_dir(), "Save States")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:10,代码来源:FSGSDirectories.py

示例6: get_hard_drives_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_hard_drives_dir(cls):
     path = cls.portable_dir("hard_drives_dir")
     if not path:
         path = os.path.join(cls.get_base_dir(), "Hard Drives")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:10,代码来源:FSGSDirectories.py

示例7: get_logs_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_logs_dir(cls):
     path = cls.portable_dir("logs_dir")
     if not path:
         path = os.path.join(cls.get_cache_dir(), "Logs")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:10,代码来源:FSGSDirectories.py

示例8: downloads_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def downloads_dir(cls):
     path = cls.portable_dir("downloads_dir")
     if not path:
         path = os.path.join(cls.get_base_dir(), "Downloads")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:10,代码来源:FSGSDirectories.py

示例9: get_floppies_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_floppies_dir(cls):
     path = cls.portable_dir("floppies_dir")
     if not path:
         path = os.path.join(cls.get_base_dir(), "Floppies")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:10,代码来源:FSGSDirectories.py

示例10: multiselect

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
    def multiselect(cls, parent=None):
        default_dir = FSGSDirectories.get_floppies_dir()
        dialog = LauncherFilePicker(
            parent, gettext("Select Multiple Floppies"),
            "floppy", multiple=True)
        if not dialog.show_modal():
            return
        original_paths = dialog.get_paths()
        original_paths.sort()
        paths = []
        for path in original_paths:
            path = Paths.get_real_case(path)
            embedded_files = []
            if path.endswith(".zip"):
                archive = Archive(path)
                files = archive.list_files()
                for file in files:
                    name, ext = os.path.splitext(file)
                    # FIXME: get list of floppy extensions from a central
                    # place
                    if ext in [".adf", ".ipf"]:
                        embedded_files.append(file)
            if len(embedded_files) > 0:
                embedded_files.sort()
                print("found embedded floppy images:")
                print(embedded_files)
                for file in embedded_files:
                    paths.append(file)
            else:
                paths.append(path)

        checksum_tool = ChecksumTool(parent)
        for i, path in enumerate(paths):
            sha1 = checksum_tool.checksum(path)
            path = Paths.contract_path(
                path, default_dir, force_real_case=False)

            if i < 4:
                LauncherConfig.set_multiple([
                    ("floppy_drive_{0}".format(i), path),
                    ("x_floppy_drive_{0}_sha1".format(i), sha1)])
            LauncherConfig.set_multiple([
                ("floppy_image_{0}".format(i), path),
                ("x_floppy_image_{0}_sha1".format(i), sha1)])

        # blank the rest of the drives
        for i in range(len(paths), 4):
            LauncherConfig.set_multiple([
                ("floppy_drive_{0}".format(i), ""),
                ("x_floppy_drive_{0}_sha1".format(i), "")])
        # blank the rest of the image list
        for i in range(len(paths), 20):
            LauncherConfig.set_multiple([
                ("floppy_image_{0}".format(i), ""),
                ("x_floppy_image_{0}_sha1".format(i), "")])
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:57,代码来源:floppy_manager.py

示例11: get_controllers_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_controllers_dir(cls):
     path = cls.portable_dir("controllers_dir")
     if not path:
         if openretro:
             path = os.path.join(cls.get_data_dir(), "Devs", "Joysticks")
         else:
             path = os.path.join(cls.get_base_dir(), "Controllers")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
开发者ID:FrodeSolheim,项目名称:fs-uae-launcher,代码行数:13,代码来源:FSGSDirectories.py

示例12: get_configurations_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_configurations_dir(cls):
     path = cls.portable_dir("configurations_dir")
     if not path:
         if openretro:
             path = os.path.join(cls.get_data_dir(), "Configs")
         else:
             path = os.path.join(cls.get_base_dir(), "Configurations")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
开发者ID:FrodeSolheim,项目名称:fs-uae-launcher,代码行数:13,代码来源:FSGSDirectories.py

示例13: get_cdroms_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_cdroms_dir(cls):
     path = cls.portable_dir("cdroms_dir")
     if not path:
         if openretro:
             path = os.path.join(cls.media_dir(), "CD-ROMs")
         else:
             path = os.path.join(cls.get_base_dir(), "CD-ROMs")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
开发者ID:FrodeSolheim,项目名称:fs-uae-launcher,代码行数:13,代码来源:FSGSDirectories.py

示例14: scan

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
    def scan(self):
        self.set_status(gettext("Scanning files"), gettext("Scanning files"))
        file_database = FileDatabase.get_instance()
        # database.clear()
        scan_dirs = self.get_scan_dirs()

        if self.purge_other_dirs:
            all_database_file_ids = file_database.get_file_ids()
        else:
            all_database_file_ids = None

        for dir_ in scan_dirs:
            if not os.path.exists(dir_):
                print("[FILES] Scanner: Directory does not exist:", dir_)
                continue
            # this is important to make sure the database is portable across
            # operating systems
            dir_ = Paths.get_real_case(dir_)

            self.database_file_ids = file_database.get_file_hierarchy_ids(dir_)
            if self.purge_other_dirs:
                all_database_file_ids.difference_update(self.database_file_ids)

            self.scan_dir(file_database, dir_)

            print("Remaining files:", self.database_file_ids)
            self.purge_file_ids(self.database_file_ids)

            self.set_status(
                gettext("Scanning files"), gettext("Committing data...")
            )
            # update last_file_insert and last_file_delete
            file_database.update_last_event_stamps()
            print("[FILES] FileScanner.scan - committing data")
            file_database.commit()

        if self.purge_other_dirs:
            self.purge_file_ids(all_database_file_ids)

        if self.stop_check():
            file_database.rollback()
        else:
            self.set_status(
                gettext("Scanning files"), gettext("Committing data...")
            )
            print("[FILES] FileScanner.scan - committing data")
            file_database.commit()
开发者ID:,项目名称:,代码行数:49,代码来源:

示例15: get_base_dir

# 需要导入模块: from fsbc.paths import Paths [as 别名]
# 或者: from fsbc.paths.Paths import get_real_case [as 别名]
 def get_base_dir(cls):
     path = fsboot.base_dir()
     # Configuration and file database depends on path normalization,
     # especially for cross-platform portable mode.
     path = Paths.get_real_case(path)
     return path
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:8,代码来源:FSGSDirectories.py


注:本文中的fsbc.paths.Paths.get_real_case方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。