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

Make the tagger archive path os independent #244

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Make the tagger archive path os independent #244

wants to merge 2 commits into from

Conversation

dannystaple
Copy link

Solution to issue #235 - regardless of the separator used, it will work in windows and unix environments.

Solution to issue #235 - regardless of the separator used, it will work in windows and unix environments.
@dannystaple
Copy link
Author

Tested on windows.

Need that too.
@@ -376,7 +377,8 @@ def _create_tag_archive(self, config):
raise HydeException("No Template specified in tagger configuration.")
content = self.site.content.source_folder
source = Folder(config.get('source', ''))
target = content.child_folder(config.get('target', 'tags'))
target_prop = os.path.join(*re.split('[\\/]', config.get('target', 'tags')))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be carefull here! You are splitting with re's both \ and / but joining with os.path.

It also would be nice that such platform dependency should be hidden inside "child_folder" or config.get() (get_path()?). Either way, you should do that for every path you get from config or you pass it to a child_folder.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect you are probably right about the child_folder note - although you have to watch that links stay the web way, and only Windows FS paths go the Windows way.

Hmm - the split/join operation needs to be translating one OS separator to the other.

I am not sure about the legality of forward slashes in unix file names or backslashes in windows file names. I may be in danger here of assuming that they are not legal in them - and besides - if shared via source control, dropbox or some other means between them - it would be a problem there too - so this should be a safe assumption.

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

Successfully merging this pull request may close these issues.

None yet

2 participants