Skip to content

Commit

Permalink
Merge 6fdb7d4 into 8375d5d
Browse files Browse the repository at this point in the history
  • Loading branch information
gforcada committed Nov 10, 2019
2 parents 8375d5d + 6fdb7d4 commit 9f5ac1d
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 46 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Expand Up @@ -5,12 +5,11 @@ env:
python:
- 2.7
- 3.6
- 3.7
- 3.8
matrix:
include:
- python: "3.7"
dist: xenial
- python: "3.7"
dist: xenial
env:
- QA="true"
cache: pip
Expand Down
8 changes: 4 additions & 4 deletions haproxy/filters.py
Expand Up @@ -125,17 +125,17 @@ def filter_time_frame(start, delta):
delta_value = delta
end_value = None

if start_value is not '':
if start_value != '':
start_value = _date_str_to_datetime(start_value)

if delta_value is not '':
if delta_value != '':
delta_value = _delta_str_to_timedelta(delta_value)

if start_value is not '' and delta_value is not '':
if start_value != '' and delta_value != '':
end_value = start_value + delta_value

def filter_func(log_line):
if start_value is '':
if start_value == '':
return True
elif start_value > log_line.accept_date:
return False
Expand Down
2 changes: 1 addition & 1 deletion haproxy/line.py
Expand Up @@ -252,4 +252,4 @@ def handle_bad_http_request(self):
self.http_request_protocol = 'invalid'

if self.raw_http_request != '<BADREQ>':
print ('Could not process HTTP request {0}'.format(self.raw_http_request),)
print('Could not process HTTP request {0}'.format(self.raw_http_request),)
10 changes: 5 additions & 5 deletions haproxy/main.py
Expand Up @@ -200,7 +200,7 @@ def print_commands():
description = re.sub(r'\n\s+', ' ', description)
description = description.strip()

print ('{0}: {1}\n'.format(cmd.__name__, description))
print('{0}: {1}\n'.format(cmd.__name__, description))


def print_filters():
Expand All @@ -212,7 +212,7 @@ def print_filters():
description = re.sub(r'\n\s+', ' ', description)
description.strip()

print ('{0}: {1}\n'.format(filter_name, description))
print('{0}: {1}\n'.format(filter_name, description))


def show_help(data):
Expand Down Expand Up @@ -267,12 +267,12 @@ def main(args):
# run all commands
for command in args['commands']:
string = 'command: {0}'.format(command)
print (string)
print ('=' * len(string))
print(string)
print('=' * len(string))

cmd = getattr(log_file, 'cmd_{0}'.format(command))
result = cmd()
print (result)
print(result)

return log_file # return the log_file object so that tests can inspect it

Expand Down
2 changes: 1 addition & 1 deletion haproxy/tests/test_regex.py
Expand Up @@ -356,7 +356,7 @@ def test_http_request_regex_with_dollar_sign(self):
self.assertEqual(matches.group('path'), self.path)

def test_http_request_regex_with_single_quote_sign(self):
self.path = '/there\'s-one\'s-way-or-another\'s'
self.path = "/there's-one's-way-or-another's"
line = self._build_test_request()
matches = HTTP_REQUEST_REGEX.match(line)

Expand Down
6 changes: 4 additions & 2 deletions requirements-dev.in
Expand Up @@ -11,9 +11,11 @@ flake8-quotes
flake8-string-format
flake8-todo
isort
more-itertools < 6.0 # until we drop support for python 2.7
pip-tools
pycodestyle
pydocstyle
pydocstyle < 4.0 # until we drop support for python 2.7
pyflakes
pytest
pytest < 5.0 # until we drop support for python 2.7
pytest-cov
typed-ast ; python_version > "3.5"
58 changes: 31 additions & 27 deletions requirements-dev.txt
Expand Up @@ -6,41 +6,45 @@
#
appdirs==1.4.3 # via black
atomicwrites==1.3.0 # via pytest
attrs==19.1.0 # via black, pytest
black==19.3b0 ; python_version > "3.5"
attrs==19.3.0 # via black, pytest
black==19.10b0 ; python_version > "3.5"
click==7.0 # via black, pip-tools
coverage==4.5.3 # via pytest-cov
coverage==4.5.4 # via pytest-cov
entrypoints==0.3 # via flake8
flake8-blind-except==0.1.1
flake8-coding==1.3.1
flake8-debugger==1.4.0
flake8-deprecated==1.2
flake8-isort==2.2.1
flake8-pep3101==1.1
flake8-polyfill==1.0.1
flake8-quotes==0.11.0
flake8-coding==1.3.2
flake8-debugger==3.2.1
flake8-deprecated==1.3
flake8-isort==2.7.0
flake8-pep3101==1.2.1
flake8-polyfill==1.0.2
flake8-quotes==2.1.1
flake8-string-format==0.2.3
flake8-todo==0.7
flake8==3.3.0
importlib-metadata==0.17 # via pluggy, pytest
isort==4.2.15
flake8==3.7.9
importlib-metadata==0.23 # via pluggy, pytest
isort==4.3.21
mccabe==0.6.1 # via flake8
more-itertools==5.0.0 # via pytest
packaging==19.0 # via pytest
pip-tools==3.8.0
pluggy==0.12.0 # via pytest
more-itertools==5.0.0
packaging==19.2 # via pytest
pathspec==0.6.0 # via black
pip-tools==4.2.0
pluggy==0.13.0 # via pytest
py==1.8.0 # via pytest
pycodestyle==2.3.1
pycodestyle==2.5.0
pydocstyle==3.0.0
pyflakes==1.5.0
pyparsing==2.4.0 # via packaging
pytest-cov==2.7.1
pytest==4.6.2
six==1.12.0 # via more-itertools, packaging, pip-tools, pydocstyle, pytest
snowballstemmer==1.2.1 # via pydocstyle
testfixtures==4.9.1 # via flake8-isort
pyflakes==2.1.1
pyparsing==2.4.4 # via packaging
pytest-cov==2.8.1
pytest==4.6.6
regex==2019.11.1 # via black
six==1.13.0 # via more-itertools, packaging, pip-tools, pydocstyle, pytest
snowballstemmer==2.0.0 # via pydocstyle
testfixtures==6.10.1 # via flake8-isort
toml==0.10.0 # via black
typed-ast==1.4.0 ; python_version > "3.5"
wcwidth==0.1.7 # via pytest
zipp==0.5.1 # via importlib-metadata
zipp==0.6.0 # via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# setuptools==41.0.1 # via flake8-blind-except
# setuptools==41.6.0 # via flake8-blind-except
4 changes: 1 addition & 3 deletions setup.py
Expand Up @@ -5,9 +5,7 @@

version = '3.0.1.dev0'

description = (
'Haproxy log analyzer that tries to gives an insight of ' 'what\'s going on'
)
description = "Haproxy log analyzer that tries to gives an insight of what's going on"

long_description = """{0}
{1}
Expand Down

0 comments on commit 9f5ac1d

Please sign in to comment.