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

SelectGameDirectory Error #250

Open
MonkeyFirst opened this issue Aug 17, 2016 · 4 comments
Open

SelectGameDirectory Error #250

MonkeyFirst opened this issue Aug 17, 2016 · 4 comments
Assignees
Labels

Comments

@MonkeyFirst
Copy link

I tried to fix that like so:
init.py
line 150

    def process(self, filepath):
        if not filepath.endswith("\\"):
            filepath = filepath + '\\'

        cbPrint("PATH " + filepath)

        if not os.path.isdir(filepath):
            raise exceptions.NoGameDirectorySelected

        Configuration.game_dir = filepath
        cbPrint("Game directory: {!r}.".format(
            Configuration.game_dir),
            'debug')
@dwhite5914
Copy link
Collaborator

dwhite5914 commented Aug 17, 2016

Another option is, if the person selects a file instead of a directory, to use the parent directory of the file. This will avoid having to throw an error. If the person does select a directory, proceed as normal.

@dwhite5914 dwhite5914 added the Bug label Aug 17, 2016
@dwhite5914 dwhite5914 assigned dwhite5914 and unassigned dwhite5914 Aug 17, 2016
dwhite5914 added a commit that referenced this issue Aug 17, 2016
If you select a file and then select a directory, the filename will be
inserted into the directory name causing a bug.  Now selecting files
will not interefere with the directory name.
@MonkeyFirst
Copy link
Author

cool, I think this issue must be closed for now?

@dwhite5914
Copy link
Collaborator

dwhite5914 commented Aug 19, 2016

I have made a pull request where I make this correction and an additional correction, I'll close when we merge that pull. Thanks for bringing this to our attention, if you notice anything else, feel free to make another issue.

@travnick
Copy link
Owner

What's the point of adding trailing system specific backslash?

        if not filepath.endswith("\\"):
            filepath = filepath + '\\'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants