Fix SyntaxWarning: invalid escape sequence
This commit is contained in:
parent
38f53edc2b
commit
23321bd300
3 changed files with 7 additions and 7 deletions
2
greet.py
2
greet.py
|
@ -18,7 +18,7 @@ def grad(n):
|
|||
def fancy_greet(version):
|
||||
from rich.console import Console
|
||||
from rich.text import Text
|
||||
zc_msg = f'''
|
||||
zc_msg = fr'''
|
||||
||| . . _ _._|_ _. . . _ .__ _.. _. . __.. _ __. .
|
||||
||| //\|/ |/_| | == / / \|/ |( /_||/ | | __||/ |/ \_|
|
||||
||| \_/| |\_ |. \__\_/| |_) \_ | \/ |__|| |\__ _/
|
||||
|
|
|
@ -45,7 +45,7 @@ class UiRequestPlugin(object):
|
|||
file_obj = None
|
||||
path_parts = self.parsePath(path)
|
||||
file_path = "%s/%s/%s" % (config.data_dir, path_parts["address"], path_parts["inner_path"])
|
||||
match = re.match("^(.*\.(?:tar.gz|zip))/(.*)", file_path)
|
||||
match = re.match(r"^(.*\.(?:tar.gz|zip))/(.*)", file_path)
|
||||
archive_path, path_within = match.groups()
|
||||
if archive_path not in archive_cache:
|
||||
site = self.server.site_manager.get(path_parts["address"])
|
||||
|
@ -99,7 +99,7 @@ class UiRequestPlugin(object):
|
|||
class SiteStoragePlugin(object):
|
||||
def isFile(self, inner_path):
|
||||
if ".zip/" in inner_path or ".tar.gz/" in inner_path:
|
||||
match = re.match("^(.*\.(?:tar.gz|zip))/(.*)", inner_path)
|
||||
match = re.match(r"^(.*\.(?:tar.gz|zip))/(.*)", inner_path)
|
||||
archive_inner_path, path_within = match.groups()
|
||||
return super(SiteStoragePlugin, self).isFile(archive_inner_path)
|
||||
else:
|
||||
|
@ -127,7 +127,7 @@ class SiteStoragePlugin(object):
|
|||
|
||||
def walk(self, inner_path, *args, **kwags):
|
||||
if ".zip" in inner_path or ".tar.gz" in inner_path:
|
||||
match = re.match("^(.*\.(?:tar.gz|zip))(.*)", inner_path)
|
||||
match = re.match(r"^(.*\.(?:tar.gz|zip))(.*)", inner_path)
|
||||
archive_inner_path, path_within = match.groups()
|
||||
archive = self.openArchive(archive_inner_path)
|
||||
path_within = path_within.lstrip("/")
|
||||
|
@ -151,7 +151,7 @@ class SiteStoragePlugin(object):
|
|||
|
||||
def list(self, inner_path, *args, **kwags):
|
||||
if ".zip" in inner_path or ".tar.gz" in inner_path:
|
||||
match = re.match("^(.*\.(?:tar.gz|zip))(.*)", inner_path)
|
||||
match = re.match(r"^(.*\.(?:tar.gz|zip))(.*)", inner_path)
|
||||
archive_inner_path, path_within = match.groups()
|
||||
archive = self.openArchive(archive_inner_path)
|
||||
path_within = path_within.lstrip("/")
|
||||
|
@ -178,7 +178,7 @@ class SiteStoragePlugin(object):
|
|||
|
||||
def read(self, inner_path, mode="rb", **kwargs):
|
||||
if ".zip/" in inner_path or ".tar.gz/" in inner_path:
|
||||
match = re.match("^(.*\.(?:tar.gz|zip))(.*)", inner_path)
|
||||
match = re.match(r"^(.*\.(?:tar.gz|zip))(.*)", inner_path)
|
||||
archive_inner_path, path_within = match.groups()
|
||||
archive = self.openArchive(archive_inner_path)
|
||||
path_within = path_within.lstrip("/")
|
||||
|
|
|
@ -64,7 +64,7 @@ def pow2(x, p):
|
|||
|
||||
|
||||
def inv(z):
|
||||
"""$= z^{-1} \mod q$, for z != 0"""
|
||||
r"""$= z^{-1} \mod q$, for z != 0"""
|
||||
# Adapted from curve25519_athlon.c in djb's Curve25519.
|
||||
z2 = z * z % q # 2
|
||||
z9 = pow2(z2, 2) * z % q # 9
|
||||
|
|
Loading…
Reference in a new issue