Skip to content

import_files fails when run as a module #3

@mykter

Description

@mykter

If the plugin has been placed in the mediagoblin plugins folder then when run with python -m from the mediagoblin folder, the import_files.py script fails to find the ini file because the path to the mediagoblin module that is returned is relative. The following little change (hack?) fixes that.

if __name__ == "__main__":
    mg_dir = os.path.dirname(mediagoblin.__path__[0])
    if mg_dir == ''":
        mg_dir = './'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions