Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to have absolute path #116

Open
kud opened this issue Aug 1, 2019 · 0 comments

Comments

@kud
Copy link

commented Aug 1, 2019

A workaround:

In ModuleLoader.py:

def get_local_files(self):
        """Load the list of local files."""
        # Don't throw errors if invoked in a view without
        # a filename like the console
        local_files = []
        if not self.file_name:
            return []

        dirname = os.path.dirname(self.file_name)
        exclude = utils.dirs_to_exclude()
        for root, dirs, files in os.walk(self.project_folder, topdown=True):
            if os.path.samefile(root, self.project_folder):
                dirs[:] = [d for d in dirs if d not in exclude]

            for file_name in files:
                if file_name[0] is not '.':
                    file_name = "%s/%s" % (root, file_name)
                    # file_name = os.path.relpath(file_name, dirname)
                    file_name = os.path.relpath(file_name, self.project_folder)

                    if file_name == os.path.basename(self.file_name):
                        continue

                    # webpack trick
                    file_name = re.sub(r'^src/', '~/', file_name)

                    #if not HAS_REL_PATH_RE.match(file_name):
                    #    file_name = "./%s" % file_name

                local_files.append(file_name)
        return local_files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.