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

Modifications to work with MS Windows #1

Open
wants to merge 1 commit into
base: fix31
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ebookmaker/EbookMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import logging
import os.path
import sys
import re

import six
from six.moves import cPickle
Expand Down Expand Up @@ -410,6 +411,9 @@ def do_job (job):
close_log (log_handler)
log_handler = None

def posix_path(url):
url = re.sub('[A-Za-z]:', '', url)
return url.replace("\\", "/")

def config ():
""" Process config files and commandline params. """
Expand All @@ -433,7 +437,7 @@ def config ():
)))

if '://' not in options.url:
options.url = os.path.abspath (options.url)
options.url = posix_path(os.path.abspath(options.url))


def main ():
Expand Down
1 change: 0 additions & 1 deletion ebookmaker/writers/EpubWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,6 @@ def escape (matchobj):

url = urllib.parse.unquote (url)
url = re.sub ('^.*?://', '', url)
url = os.path.normpath (url)
url = url.replace ('/', '@')
url = re.sub ('[\\|/:?"*<>\u0000-\u001F]', escape, url)

Expand Down