Skip to content
Snippets Groups Projects
Commit 73ead3f7 authored by Sven Mäder's avatar Sven Mäder :speech_balloon:
Browse files

Improve regex

parent fa9939e5
No related branches found
No related tags found
No related merge requests found
...@@ -34,13 +34,6 @@ NODES = { ...@@ -34,13 +34,6 @@ NODES = {
} }
def getlastline(fname):
"""Using mmap to return a copy of the last line of a file"""
with open(fname) as source:
mapping = mmap.mmap(source.fileno(), 0, prot=mmap.PROT_READ)
return mapping[mapping.rfind(b'\n', 0, -1)+1:]
def sleep(start_time): def sleep(start_time):
"""After hard work, take a nap for the rest of the second""" """After hard work, take a nap for the rest of the second"""
current_time = time.perf_counter() current_time = time.perf_counter()
......
...@@ -55,7 +55,7 @@ rgx_redacted = re.compile( ...@@ -55,7 +55,7 @@ rgx_redacted = re.compile(
r'userPassword' r'userPassword'
r'):') r'):')
rgx_attr_key = re.compile(r'^(?P<key>.*?)(?P<delimiter>:[=+-:]? ?)') rgx_attr_key = re.compile(r'^(?P<key>.*?)(?P<delimiter>:[-+=#] )')
def lock(lock_file): def lock(lock_file):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment