mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 07:22:29 +03:00
fix PEP8 W605 invalid escape sequence
Python 3.7 will get a lot stricter with escape sequences. They must be valid. * https://lintlyci.github.io/Flake8Rules/rules/W605.html * https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
This commit is contained in:
parent
e6d5260c3c
commit
ff90c0246e
11 changed files with 24 additions and 24 deletions
|
@ -560,7 +560,7 @@ def clean_description(description):
|
|||
paragraph = re.sub('\r', '', paragraph)
|
||||
paragraph = re.sub('\n', ' ', paragraph)
|
||||
paragraph = re.sub(' {2,}', ' ', paragraph)
|
||||
paragraph = re.sub('^\s*(\w)', r'\1', paragraph)
|
||||
paragraph = re.sub(r'^\s*(\w)', r'\1', paragraph)
|
||||
returnstring += paragraph + '\n\n'
|
||||
return returnstring.rstrip('\n')
|
||||
|
||||
|
@ -575,8 +575,8 @@ def publishednameinfo(filename):
|
|||
return result
|
||||
|
||||
|
||||
apk_release_filename = re.compile('(?P<appid>[a-zA-Z0-9_\.]+)_(?P<vercode>[0-9]+)\.apk')
|
||||
apk_release_filename_with_sigfp = re.compile('(?P<appid>[a-zA-Z0-9_\.]+)_(?P<vercode>[0-9]+)_(?P<sigfp>[0-9a-f]{7})\.apk')
|
||||
apk_release_filename = re.compile(r'(?P<appid>[a-zA-Z0-9_\.]+)_(?P<vercode>[0-9]+)\.apk')
|
||||
apk_release_filename_with_sigfp = re.compile(r'(?P<appid>[a-zA-Z0-9_\.]+)_(?P<vercode>[0-9]+)_(?P<sigfp>[0-9a-f]{7})\.apk')
|
||||
|
||||
|
||||
def apk_parse_release_filename(apkname):
|
||||
|
@ -2479,7 +2479,7 @@ def metadata_find_signing_files(appid, vercode):
|
|||
sigs = glob.glob(os.path.join(sigdir, '*.DSA')) + \
|
||||
glob.glob(os.path.join(sigdir, '*.EC')) + \
|
||||
glob.glob(os.path.join(sigdir, '*.RSA'))
|
||||
extre = re.compile('(\.DSA|\.EC|\.RSA)$')
|
||||
extre = re.compile(r'(\.DSA|\.EC|\.RSA)$')
|
||||
for sig in sigs:
|
||||
sf = extre.sub('.SF', sig)
|
||||
if os.path.isfile(sf):
|
||||
|
@ -3011,9 +3011,9 @@ def write_to_config(thisconfig, key, value=None, config_file=None):
|
|||
|
||||
# regex for finding and replacing python string variable
|
||||
# definitions/initializations
|
||||
pattern = re.compile('^[\s#]*' + key + '\s*=\s*"[^"]*"')
|
||||
pattern = re.compile(r'^[\s#]*' + key + r'\s*=\s*"[^"]*"')
|
||||
repl = key + ' = "' + value + '"'
|
||||
pattern2 = re.compile('^[\s#]*' + key + "\s*=\s*'[^']*'")
|
||||
pattern2 = re.compile(r'^[\s#]*' + key + r"\s*=\s*'[^']*'")
|
||||
repl2 = key + " = '" + value + "'"
|
||||
|
||||
# If we replaced this line once, we make sure won't be a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue