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

Remove future, __future__ imports, fix bug with Python > 3.6, update setup.py, update readme #26

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,29 @@ 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
---

The python dateutil library is a requirement, and can be installed with pip:

# pip install python-dateutil
Mandatory:
- 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:
- pycryptodome (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 <options>

Expand Down
6 changes: 1 addition & 5 deletions quasselgrep/__main__.py
Original file line number Diff line number Diff line change
@@ -1,9 +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
from . import dateparse
Expand All @@ -16,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.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] <keywords>'

def format_option_strings(self, option):
Expand Down
3 changes: 0 additions & 3 deletions quasselgrep/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import print_function
from __future__ import absolute_import
from builtins import str
import sys
import socket
from argparse import _StoreFalseAction, _StoreTrueAction
Expand Down
3 changes: 1 addition & 2 deletions quasselgrep/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import os

defaults = {
Expand All @@ -15,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)
Expand Down
14 changes: 2 additions & 12 deletions quasselgrep/dateparse.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
from __future__ import print_function
from __future__ import absolute_import

from past.types import basestring

try:
basestring
except NameError:
basestring = str

# Copyright 2023 Jernej Jakob <[email protected]>: Removed Python 2 compatibility
# Copyright 2013 Chris Le Sueur.
# From dateparse.py, part of Whoosh, a python search library:

Expand Down Expand Up @@ -38,7 +29,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
Expand Down Expand Up @@ -84,7 +74,7 @@ class ParserBase(object):
"""

def to_parser(self, e):
if isinstance(e, basestring):
if isinstance(e, str):
return Regex(e)
else:
return e
Expand Down
1 change: 0 additions & 1 deletion quasselgrep/db.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

from builtins import object
class Db(object):
def __init__(self):
pass
Expand Down
1 change: 0 additions & 1 deletion quasselgrep/output.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
from .msgtypes import *

BUF_COL_WIDTH = 16
Expand Down
4 changes: 0 additions & 4 deletions quasselgrep/query.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from builtins import object
from . import output
from .msgtypes import *

Expand Down
5 changes: 0 additions & 5 deletions quasselgrep/server.py
Original file line number Diff line number Diff line change
@@ -1,8 +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 socketserver import ThreadingTCPServer, TCPServer, BaseRequestHandler
from shlex import split
from os import urandom
Expand Down
1 change: 0 additions & 1 deletion quasselgrep/times.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,31 @@

setup(
name='quasselgrep',
version='0.1',
version='0.2',
description='quasselgrep',
long_description=long_description,
author='Chris Le Sueur',
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(),

extras_require = {
"PostgreSQL": ["psycopg2"],
},

# 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)',
],

Expand Down