Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More regex and requirements fixes #41

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/python/asterisk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def __init__(self, name, template=False):
self.name = name
self.template = template
self.varval_re = re.compile("""
\s* # Leading whitespace
(?P<name>[\w|,\.-]+) # Option name
\s*=>?\s* # Separator, = or =>
(?P<value>[\w\s=_()/@|,'"\.<>:-]*) # Option value (can be zero-length)
\\s* # Leading whitespace
(?P<name>[\\w|,\\.-]+) # Option name
\\s*=>?\\s* # Separator, = or =>
(?P<value>[\\w\\s=_()/@|,'"\\.<>:-]*) # Option value (can be zero-length)
(?:;.*)?$ # Optional comment before end of line
""", re.VERBOSE)

Expand Down Expand Up @@ -71,10 +71,10 @@ def __init__(self, filename, config_str=None):
"""
self.categories = []
self.category_re = re.compile("""
\s* # Leading Whitespace
\[(?P<name>[\w,\.-]+)\] # Category name in square brackets
(?:\((?P<template>[!])\))? # Optionally marked as a template
\s*(?:;.*)?$ # trailing whitespace or a comment
\\s* # Leading Whitespace
\\[(?P<name>[\\w,\\.-]+)\\] # Category name in square brackets
(?:\\((?P<template>[!])\\))? # Optionally marked as a template
\\s*(?:;.*)?$ # trailing whitespace or a comment
""", re.VERBOSE)

if config_str is None:
Expand Down
2 changes: 1 addition & 1 deletion lib/python/asterisk/opensslversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __parse_version(self, version_str):
"""Parse the version string"""
vv = 0
if version_str is not None:
parts = re.split("(\d+)[.](\d+)[.](\d+)([a-z]+)?(?:-(.+))?", version_str)
parts = re.split("(\\d+)[.](\\d+)[.](\\d+)([a-z]+)?(?:-(.+))?", version_str)
if parts[1]:
vv += int(parts[1]) << 28
if parts[2]:
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ cffi==1.15.0
charset-normalizer==2.0.12
constantly==15.1.0
construct==2.10.68
cryptography==37.0.2
Cython==0.29.30
hyperlink==21.0.0
idna==3.3
Expand All @@ -15,10 +14,12 @@ lxml==5.1.0
netifaces>=0.10.4
numpy>=1.19.5
pycparser==2.21
pyOpenSSL==24.0.0
PyYAML==6.0.1
PyXB-X==1.2.6.1
rawsocket==0.2
requests==2.27.1
service_identity==24.1.0
six==1.16.0
Twisted==22.4.0
txaio==22.2.1
Expand Down
Loading