aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2014-01-03 16:50:15 +0100
committerMatěj Cepl <mcepl@redhat.com>2014-01-03 16:51:16 +0100
commit1fee9ca55f623b5f9bbe6c425d97696c018addeb (patch)
tree1e20ae1284ff838639de098ca7689c6fedfad735
parente04a64494a0468b17066ec57799d3335a46cfa0c (diff)
downloadgg_scraper-1fee9ca55f623b5f9bbe6c425d97696c018addeb.tar.gz
Create setup.py and add GPLv3 license.
Fixes #282
-rwxr-xr-xgg_scrapper.py19
-rw-r--r--setup.py52
2 files changed, 71 insertions, 0 deletions
diff --git a/gg_scrapper.py b/gg_scrapper.py
index f4d3263..c464565 100755
--- a/gg_scrapper.py
+++ b/gg_scrapper.py
@@ -1,4 +1,21 @@
#!/usr/bin/python3
+"""
+Download a Google Group to MBOX
+Copyright (C) 2014 Matěj Cepl
+
+This program is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation, either version 3 of the License, or (at your
+option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program. If not, see <http://www.gnu.org/licenses/>.'
+"""
import argparse
from configparser import ConfigParser
@@ -22,6 +39,8 @@ MANGLED_ADDR_RE = re.compile(
r'([a-zA-Z0-9_.+-]+\.\.\.@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)',
re.IGNORECASE)
+__version__ = '0.1'
+
class Page(object):
verb_handler = urllib.request.HTTPHandler()
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..b4d8a71
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,52 @@
+from distutils.core import setup, Command
+import unittest
+
+import gg_scrapper
+
+
+class RunTests(Command):
+ """New setup.py command to run all tests for the package.
+ """
+ description = "run all tests for the package"
+
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ tests = unittest.TestLoader().discover('test')
+ runner = unittest.TextTestRunner(verbosity=2)
+ runner.run(tests)
+
+
+classifiers = [
+ 'Development Status :: 3 - Alpha',
+ 'Operating System :: OS Independent',
+ 'Intended Audience :: Information Technology',
+ 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
+ 'Natural Language :: English',
+ 'Programming Language :: Python :: 3',
+ 'Topic :: Communications :: Email',
+ 'Topic :: Communications :: Conferencing']
+
+
+def get_long_description():
+ lines = open('README.rst').read().splitlines(False)
+ return '\n' + '\n'.join(lines) + '\n'
+
+setup(name='rope',
+ version=gg_scrapper.__version__,
+ description='Download a Google Group to MBOX',
+ long_description=get_long_description(),
+ author='Matěj Cepl',
+ author_email='mcepl@cepl.eu',
+ url='http://luther.ceplovi.cz/git/gg_scrapper.git',
+ license='GNU GPL',
+ classifiers=classifiers,
+ cmdclass={
+ 'test': RunTests,
+ })