예제 #1
0
def from_config(config):
    """Instantiate a ScriptDirectory from the given config using generic
    resource finder.
    """
    script_location = config.get_main_option('script_location')
    if script_location is None:
        raise RuntimeError("No 'script_location' key "
                           "found in configuration.")

    import nxdrive
    nxdrive_path = os.path.dirname(nxdrive.__file__)
    alembic_path = nxdrive_path.replace('nxdrive', script_location)

    return ScriptDirectory(find_resource_dir(script_location, alembic_path))
예제 #2
0
def from_config(config):
    """Instantiate a ScriptDirectory from the given config using generic
    resource finder.
    """
    script_location = config.get_main_option('script_location')
    if script_location is None:
        raise RuntimeError("No 'script_location' key "
                                "found in configuration.")

    import nxdrive
    nxdrive_path = os.path.dirname(nxdrive.__file__)
    alembic_path = nxdrive_path.replace('nxdrive', script_location)

    return ScriptDirectory(
                find_resource_dir(script_location, alembic_path)
                )
예제 #3
0
def find_icon(icon_filename):
    """Find the FS path of an icon in various OS binary packages"""
    import nxdrive
    nxdrive_path = os.path.dirname(nxdrive.__file__)
    icons_path = os.path.join(nxdrive_path, 'data', 'icons')
    icons_dir = find_resource_dir('icons', icons_path)

    if icons_dir is None:
        log.warning(
            "Could not find icon file %s as icons directory"
            " could not be found", icon_filename)
        return None

    icon_filepath = os.path.join(icons_dir, icon_filename)
    if not os.path.exists(icon_filepath):
        log.warning("Could not find icon file: %s", icon_filepath)
        return None

    return icon_filepath
예제 #4
0
def find_icon(icon_filename):
    """Find the FS path of an icon in various OS binary packages"""
    import nxdrive
    nxdrive_path = os.path.dirname(nxdrive.__file__)
    icons_path = os.path.join(nxdrive_path, 'data', 'icons')
    icons_dir = find_resource_dir('icons', icons_path)

    if icons_dir is None:
        log.warning("Could not find icon file %s as icons directory"
                    " could not be found",
                    icon_filename)
        return None

    icon_filepath = os.path.join(icons_dir, icon_filename)
    if not os.path.exists(icon_filepath):
        log.warning("Could not find icon file: %s", icon_filepath)
        return None

    return icon_filepath
예제 #5
0
 def get_htmlpage(self, page):
     import nxdrive
     nxdrive_path = os.path.dirname(nxdrive.__file__)
     ui_path = os.path.join(nxdrive_path, 'data', self._get_skin())
     return os.path.join(find_resource_dir(self._get_skin(), ui_path),
                         page).replace("\\", "/")
예제 #6
0
 def get_htmlpage(self, page):
     import nxdrive
     nxdrive_path = os.path.dirname(nxdrive.__file__)
     ui_path = os.path.join(nxdrive_path, 'data', self._get_skin())
     return os.path.join(find_resource_dir(self._get_skin(), ui_path), page).replace("\\","/")
예제 #7
0
 def get_htmlpage(self, page):
     import nxdrive
     nxdrive_path = os.path.dirname(nxdrive.__file__)
     ui_path = os.path.join(nxdrive_path, 'data', Options.theme)
     return (os.path.join(find_resource_dir(Options.theme, ui_path),
                          page).replace('\\', '/'))
예제 #8
0
 def get_htmlpage(self, page):
     import nxdrive
     nxdrive_path = os.path.dirname(nxdrive.__file__)
     ui_path = os.path.join(nxdrive_path, 'data', Options.theme)
     return (os.path.join(find_resource_dir(Options.theme, ui_path), page)
                    .replace('\\', '/'))