|
|
@ -1,6 +1,6 @@
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import re
|
|
|
|
import urlparse
|
|
|
|
from .p3 import urlparse
|
|
|
|
|
|
|
|
|
|
|
|
from .content import (check_file, check_directory, read_file, write_file,
|
|
|
|
from .content import (check_file, check_directory, read_file, write_file,
|
|
|
|
system_path, check_content, content_type, get_content)
|
|
|
|
system_path, check_content, content_type, get_content)
|
|
|
@ -122,7 +122,7 @@ class DocBroker(object):
|
|
|
|
|
|
|
|
|
|
|
|
def in_docsdir(self, docpath):
|
|
|
|
def in_docsdir(self, docpath):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
parsed = urlparse.urlparse(docpath)
|
|
|
|
parsed = urlparse(docpath)
|
|
|
|
except Exception:
|
|
|
|
except Exception:
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
return parsed.scheme == self.scheme
|
|
|
|
return parsed.scheme == self.scheme
|
|
|
@ -136,7 +136,7 @@ class DocBroker(object):
|
|
|
|
Return absoluted paths of regular ones otherwise.
|
|
|
|
Return absoluted paths of regular ones otherwise.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
if self.in_docsdir(docpath):
|
|
|
|
if self.in_docsdir(docpath):
|
|
|
|
parsed = urlparse.urlparse(docpath)
|
|
|
|
parsed = urlparse(docpath)
|
|
|
|
if parsed.path == '':
|
|
|
|
if parsed.path == '':
|
|
|
|
docpath = os.path.join(self.docdir, parsed.netloc)
|
|
|
|
docpath = os.path.join(self.docdir, parsed.netloc)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|