mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
Updates vendored subliminal to 2.1.0
Updates rarfile to 3.1 Updates stevedore to 3.5.0 Updates appdirs to 1.4.4 Updates click to 8.1.3 Updates decorator to 5.1.1 Updates dogpile.cache to 1.1.8 Updates pbr to 5.11.0 Updates pysrt to 1.1.2 Updates pytz to 2022.6 Adds importlib-metadata version 3.1.1 Adds typing-extensions version 4.1.1 Adds zipp version 3.11.0
This commit is contained in:
parent
d8da02cb69
commit
f05b09f349
694 changed files with 16621 additions and 11056 deletions
|
@ -14,6 +14,7 @@
|
|||
# under the License.
|
||||
|
||||
import os
|
||||
import shlex
|
||||
import sys
|
||||
|
||||
from pbr import find_package
|
||||
|
@ -35,6 +36,21 @@ def get_man_section(section):
|
|||
return os.path.join(get_manpath(), 'man%s' % section)
|
||||
|
||||
|
||||
def unquote_path(path):
|
||||
# unquote the full path, e.g: "'a/full/path'" becomes "a/full/path", also
|
||||
# strip the quotes off individual path components because os.walk cannot
|
||||
# handle paths like: "'i like spaces'/'another dir'", so we will pass it
|
||||
# "i like spaces/another dir" instead.
|
||||
|
||||
if os.name == 'nt':
|
||||
# shlex cannot handle paths that contain backslashes, treating those
|
||||
# as escape characters.
|
||||
path = path.replace("\\", "/")
|
||||
return "".join(shlex.split(path)).replace("/", "\\")
|
||||
|
||||
return "".join(shlex.split(path))
|
||||
|
||||
|
||||
class FilesConfig(base.BaseConfig):
|
||||
|
||||
section = 'files'
|
||||
|
@ -57,21 +73,28 @@ class FilesConfig(base.BaseConfig):
|
|||
target = target.strip()
|
||||
if not target.endswith(os.path.sep):
|
||||
target += os.path.sep
|
||||
for (dirpath, dirnames, fnames) in os.walk(source_prefix):
|
||||
finished.append(
|
||||
"%s = " % dirpath.replace(source_prefix, target))
|
||||
unquoted_prefix = unquote_path(source_prefix)
|
||||
unquoted_target = unquote_path(target)
|
||||
for (dirpath, dirnames, fnames) in os.walk(unquoted_prefix):
|
||||
# As source_prefix is always matched, using replace with a
|
||||
# a limit of one is always going to replace the path prefix
|
||||
# and not accidentally replace some text in the middle of
|
||||
# the path
|
||||
new_prefix = dirpath.replace(unquoted_prefix,
|
||||
unquoted_target, 1)
|
||||
finished.append("'%s' = " % new_prefix)
|
||||
finished.extend(
|
||||
[" %s" % os.path.join(dirpath, f) for f in fnames])
|
||||
[" '%s'" % os.path.join(dirpath, f) for f in fnames])
|
||||
else:
|
||||
finished.append(line)
|
||||
|
||||
self.data_files = "\n".join(finished)
|
||||
|
||||
def add_man_path(self, man_path):
|
||||
self.data_files = "%s\n%s =" % (self.data_files, man_path)
|
||||
self.data_files = "%s\n'%s' =" % (self.data_files, man_path)
|
||||
|
||||
def add_man_page(self, man_page):
|
||||
self.data_files = "%s\n %s" % (self.data_files, man_page)
|
||||
self.data_files = "%s\n '%s'" % (self.data_files, man_page)
|
||||
|
||||
def get_man_sections(self):
|
||||
man_sections = dict()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue