From c0ac9050c14bec37099566127712b32fbfe05b89 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Fri, 9 Jun 2023 23:15:02 +0200 Subject: [PATCH 01/12] Remove __future__ imports Not necessary in current Python 3 versions any more --- quasselgrep/__main__.py | 3 --- quasselgrep/client.py | 2 -- quasselgrep/config.py | 1 - quasselgrep/dateparse.py | 3 --- quasselgrep/output.py | 1 - quasselgrep/query.py | 2 -- quasselgrep/server.py | 2 -- 7 files changed, 14 deletions(-) diff --git a/quasselgrep/__main__.py b/quasselgrep/__main__.py index e27c814..e978c0b 100755 --- a/quasselgrep/__main__.py +++ b/quasselgrep/__main__.py @@ -1,8 +1,5 @@ #!/usr/bin/env python -from __future__ import print_function -from __future__ import absolute_import - from builtins import object, str from .db import Db from .query import Query diff --git a/quasselgrep/client.py b/quasselgrep/client.py index 3f57441..cfecd47 100644 --- a/quasselgrep/client.py +++ b/quasselgrep/client.py @@ -1,5 +1,3 @@ -from __future__ import print_function -from __future__ import absolute_import from builtins import str import sys import socket diff --git a/quasselgrep/config.py b/quasselgrep/config.py index 14b6520..1aed7cb 100644 --- a/quasselgrep/config.py +++ b/quasselgrep/config.py @@ -1,4 +1,3 @@ -from __future__ import print_function import os defaults = { diff --git a/quasselgrep/dateparse.py b/quasselgrep/dateparse.py index 7e19518..c5b587d 100644 --- a/quasselgrep/dateparse.py +++ b/quasselgrep/dateparse.py @@ -1,6 +1,3 @@ -from __future__ import print_function -from __future__ import absolute_import - from past.types import basestring try: diff --git a/quasselgrep/output.py b/quasselgrep/output.py index 8c9ab8e..30187a6 100644 --- a/quasselgrep/output.py +++ b/quasselgrep/output.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import from .msgtypes import * BUF_COL_WIDTH = 16 diff --git a/quasselgrep/query.py b/quasselgrep/query.py index d48a7b1..fd0f4d1 100644 --- a/quasselgrep/query.py +++ b/quasselgrep/query.py @@ -1,5 +1,3 @@ -from __future__ import print_function -from __future__ import absolute_import from builtins import range from builtins import object from . import output diff --git a/quasselgrep/server.py b/quasselgrep/server.py index 6ff3a3c..f1e5520 100644 --- a/quasselgrep/server.py +++ b/quasselgrep/server.py @@ -1,5 +1,3 @@ -from __future__ import print_function -from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import object From 4ed5ae5c183fad4ed3eac1efa15299e58ccb1186 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Sat, 10 Jun 2023 00:06:16 +0200 Subject: [PATCH 02/12] Remove future import --- quasselgrep/server.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/quasselgrep/server.py b/quasselgrep/server.py index f1e5520..8ebbaf0 100644 --- a/quasselgrep/server.py +++ b/quasselgrep/server.py @@ -1,5 +1,3 @@ -from future import standard_library -standard_library.install_aliases() from builtins import object from socketserver import ThreadingTCPServer, TCPServer, BaseRequestHandler from shlex import split From af23f353a21e0d58b4010d6bec89e51579a9b9b6 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Sat, 10 Jun 2023 00:07:14 +0200 Subject: [PATCH 03/12] open "universal newlines" mode is no longer supported (is now default) --- quasselgrep/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quasselgrep/config.py b/quasselgrep/config.py index 1aed7cb..17ce3cc 100644 --- a/quasselgrep/config.py +++ b/quasselgrep/config.py @@ -14,7 +14,7 @@ } def loadconfig(filename, namespace): - with open(filename, 'rbU') as fd: + with open(filename, 'rb') as fd: source = fd.read() code = compile(source, filename, 'exec') exec(code, namespace) From b18fb61b05ada9d2906d6928a6594d5a2599c461 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Sat, 10 Jun 2023 13:43:14 +0200 Subject: [PATCH 04/12] setup.py: update to support Python >= 3.7 --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 166d95e..8e9fd92 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ author_email='', url='https://github.com/fish-face/quasselgrep', license="GPLv2", + python_requires=">=3.7", install_requires=REQUIREMENTS, keywords=['quassel', 'quasselgrep', 'irc', 'logs'], packages=find_packages(), @@ -38,7 +39,12 @@ # See https://pypi.python.org/pypi?%3Aaction=list_classifiers for others classifiers=[ 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', ], From 3f8b8e932a6a9bf1d01133788ab93dad639e31f2 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Sat, 10 Jun 2023 13:48:33 +0200 Subject: [PATCH 05/12] setup.py: add extras_require postgresql psycopg2 --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index 8e9fd92..8636729 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,10 @@ keywords=['quassel', 'quasselgrep', 'irc', 'logs'], packages=find_packages(), + extras_require = { + "PostgreSQL": ["psycopg2"], + }, + # See https://pypi.python.org/pypi?%3Aaction=list_classifiers for others classifiers=[ 'Programming Language :: Python', From 3f6e2b1d54816fbdc17cc5d93acb2d53fe5aae5c Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Sat, 10 Jun 2023 13:49:32 +0200 Subject: [PATCH 06/12] README.md: update dependencies and installation sections --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index dccf2eb..efc5b1b 100644 --- a/README.md +++ b/README.md @@ -6,23 +6,23 @@ Tool for searching quassel logs from the commandline Requirements --- -The python dateutil library is a requirement, and can be installed with pip: +Mandatory: +- python-dateutil - # pip install python-dateutil - -To run quasselgrep as a server or client, you'll need python's crypto module. -For instance, on Debian-based systems, run: - - # apt-get install python-crypto +Optional: +- python-crypto (to run as client/server) +- psycopg2 (for PostgreSQL support) Installation --- -You don't need to install quasselgrep to use it but it might be more convenient. To do so run: +You don't need to install quasselgrep to use it but it might be more convenient. Install it via your system's package manager. + +If a package is not available for your OS, you can install it with pip: # sudo pip install . -from the root directory. You can also install it as a local user, or by directly running setup.py, of course. Having done this you will be able to run the `quasselgrep` command at the shell. If you don't install it like this, either use: +from the root directory. You can also install it as a local user or in a virtualenv or by directly running setup.py. Having done this you will be able to run the `quasselgrep` command at the shell. If you don't install it like this, either use: $ ./launch.py From e4a4891d47d215adf7765f9d4b66115085f7fe86 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Sat, 10 Jun 2023 13:50:04 +0200 Subject: [PATCH 07/12] README.md: add Repology badge and link to gentoo overlay --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index efc5b1b..ac88d96 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ quasselgrep Tool for searching quassel logs from the commandline +[![Packaging status](https://repology.org/badge/tiny-repos/quasselgrep.svg)](https://repology.org/project/quasselgrep/versions) +[Gentoo overlay](https://github.com/jjakob/gentoo-overlay/net-irc/quasselgrep) + Requirements --- From a8e052e7da389f1796b1f19a0de73867bb5d4846 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Mon, 17 Jul 2023 03:27:56 +0200 Subject: [PATCH 08/12] Remove future builtins imports --- quasselgrep/__main__.py | 1 - quasselgrep/client.py | 1 - quasselgrep/dateparse.py | 1 - quasselgrep/db.py | 1 - quasselgrep/query.py | 2 -- quasselgrep/server.py | 1 - quasselgrep/times.py | 1 - 7 files changed, 8 deletions(-) diff --git a/quasselgrep/__main__.py b/quasselgrep/__main__.py index e978c0b..5811630 100755 --- a/quasselgrep/__main__.py +++ b/quasselgrep/__main__.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -from builtins import object, str from .db import Db from .query import Query from . import dateparse diff --git a/quasselgrep/client.py b/quasselgrep/client.py index cfecd47..cf82208 100644 --- a/quasselgrep/client.py +++ b/quasselgrep/client.py @@ -1,4 +1,3 @@ -from builtins import str import sys import socket from argparse import _StoreFalseAction, _StoreTrueAction diff --git a/quasselgrep/dateparse.py b/quasselgrep/dateparse.py index c5b587d..1426d75 100644 --- a/quasselgrep/dateparse.py +++ b/quasselgrep/dateparse.py @@ -35,7 +35,6 @@ # those of the authors and should not be interpreted as representing official # policies, either expressed or implied, of Matt Chaput. -from builtins import object, str import re import sys from datetime import datetime, timedelta diff --git a/quasselgrep/db.py b/quasselgrep/db.py index 116584d..506fea7 100644 --- a/quasselgrep/db.py +++ b/quasselgrep/db.py @@ -1,5 +1,4 @@ -from builtins import object class Db(object): def __init__(self): pass diff --git a/quasselgrep/query.py b/quasselgrep/query.py index fd0f4d1..21144c2 100644 --- a/quasselgrep/query.py +++ b/quasselgrep/query.py @@ -1,5 +1,3 @@ -from builtins import range -from builtins import object from . import output from .msgtypes import * diff --git a/quasselgrep/server.py b/quasselgrep/server.py index 8ebbaf0..4c8ceb7 100644 --- a/quasselgrep/server.py +++ b/quasselgrep/server.py @@ -1,4 +1,3 @@ -from builtins import object from socketserver import ThreadingTCPServer, TCPServer, BaseRequestHandler from shlex import split from os import urandom diff --git a/quasselgrep/times.py b/quasselgrep/times.py index 3c94945..9c56b94 100644 --- a/quasselgrep/times.py +++ b/quasselgrep/times.py @@ -28,7 +28,6 @@ # those of the authors and should not be interpreted as representing official # policies, either expressed or implied, of Matt Chaput. -from builtins import object import calendar import copy from datetime import date, datetime, timedelta From 98d8cfe633d4cf1404a17714dfe480c61fe2e66c Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Mon, 17 Jul 2023 03:28:54 +0200 Subject: [PATCH 09/12] Remove past import --- quasselgrep/dateparse.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/quasselgrep/dateparse.py b/quasselgrep/dateparse.py index 1426d75..ce3299e 100644 --- a/quasselgrep/dateparse.py +++ b/quasselgrep/dateparse.py @@ -1,10 +1,3 @@ -from past.types import basestring - -try: - basestring -except NameError: - basestring = str - # Copyright 2013 Chris Le Sueur. # From dateparse.py, part of Whoosh, a python search library: @@ -80,7 +73,7 @@ class ParserBase(object): """ def to_parser(self, e): - if isinstance(e, basestring): + if isinstance(e, str): return Regex(e) else: return e From a336542f64ba60db3d47e021bf7caf91de9717cc Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Mon, 17 Jul 2023 03:33:39 +0200 Subject: [PATCH 10/12] README.md: python-crypto is pycryptodome in Python 3 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ac88d96..d50bbec 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Mandatory: - python-dateutil Optional: -- python-crypto (to run as client/server) +- pycryptodome (to run as client/server) - psycopg2 (for PostgreSQL support) Installation From fe16af7c41e126d9a5c422c05754423c8356ee2f Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Mon, 17 Jul 2023 03:35:53 +0200 Subject: [PATCH 11/12] Add myself to copyright notices --- quasselgrep/__main__.py | 2 +- quasselgrep/dateparse.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/quasselgrep/__main__.py b/quasselgrep/__main__.py index 5811630..ad939a2 100755 --- a/quasselgrep/__main__.py +++ b/quasselgrep/__main__.py @@ -12,7 +12,7 @@ from argparse import HelpFormatter as Formatter #IndentedHelpFormatter as Formatter from argparse import Namespace -version = u'Quasselgrep 0.1\nCopyright (c) 2013 Chris Le Sueur\nThis program is licensed under the GNU General Public License' +version = u'Quasselgrep 0.1\nCopyright (c) 2013 Chris Le Sueur\nCopyright (c) 2023 Jernej Jakob\nThis program is licensed under the GNU General Public License' usage = u'%(prog)s [options] ' def format_option_strings(self, option): diff --git a/quasselgrep/dateparse.py b/quasselgrep/dateparse.py index ce3299e..6bb34ac 100644 --- a/quasselgrep/dateparse.py +++ b/quasselgrep/dateparse.py @@ -1,3 +1,4 @@ +# Copyright 2023 Jernej Jakob : Removed Python 2 compatibility # Copyright 2013 Chris Le Sueur. # From dateparse.py, part of Whoosh, a python search library: From ff64004bd92f1fc421bd3da46e7bf2175dcf42d3 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Mon, 17 Jul 2023 03:36:43 +0200 Subject: [PATCH 12/12] Bump version to 0.2 --- quasselgrep/__main__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quasselgrep/__main__.py b/quasselgrep/__main__.py index ad939a2..1dfc690 100755 --- a/quasselgrep/__main__.py +++ b/quasselgrep/__main__.py @@ -12,7 +12,7 @@ from argparse import HelpFormatter as Formatter #IndentedHelpFormatter as Formatter from argparse import Namespace -version = u'Quasselgrep 0.1\nCopyright (c) 2013 Chris Le Sueur\nCopyright (c) 2023 Jernej Jakob\nThis program is licensed under the GNU General Public License' +version = u'Quasselgrep 0.2\nCopyright (c) 2013 Chris Le Sueur\nCopyright (c) 2023 Jernej Jakob\nThis program is licensed under the GNU General Public License' usage = u'%(prog)s [options] ' def format_option_strings(self, option): diff --git a/setup.py b/setup.py index 8636729..d63fa5a 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup( name='quasselgrep', - version='0.1', + version='0.2', description='quasselgrep', long_description=long_description, author='Chris Le Sueur',