Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - dmagbone

Pages: [1]
1
DF General Discussion / Re: PeridexisErrant's DF Starter Pack
« on: June 21, 2017, 08:53:37 pm »
You are selecting the right folder. It's not working for me either, which is strange because it was working for me when I was running from source. And the importer code hasn't changed any since then.

I was reading stackoverflow, and it says that "or" sometimes doesn't do anything. Maybe that's the trouble here. Here's the relevant lines of code from the importer py:
Code: [Select]
    if not (os.path.isdir(src_prefix) or os.path.dirname(src_prefix)):
        # parent dir is a real path, even when os.path.commonprefix isn't
        msg = 'Can only import content from single basedir'


I'm wondering if maybe it's only checking that "os.path.isdir(src_prefix)" and completely ignoring the "os.path.dirname(src_prefix)".

That statoverflow question is 3 years old. Maybe this was a bug in an older version of Python that has since been fixed. And maybe the bundled version of Python is out-of-date. This would explain why it might only work properly when running from source, anyway.

Sorry, if this is stupid and doesn't make any sense at all. I'm not a programmer.

I'm having this same error with "Can only import content from single basedir"

I don't have my py enviorn set up on this machine, and its been a while since i tried to code in py anyway, but is this a parentheses error? Should it be

 if not ( (os.path.isdir(src_prefix) or os.path.dirname(src_prefix)) ):

That is, is the correct eval for
NOT (A OR B)
or is the correct eval for
(NOT(A)) OR (B)


Pages: [1]