From 6a7adc4325381d4ba3d7e1f8f8f49c67e9f2730e Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Wed, 7 Feb 2018 18:46:23 +0530 Subject: [PATCH] Packaged with distutils --- .gitignore | 2 ++ LICENSE.txt => LICENSE | 0 MANIFEST.in | 1 + README.txt => README | 26 ++++++++++++++++++++-- run | 25 +++++++++++++++++++++ script/statin | 25 +++++++++++++++++++++ setup.py | 45 ++++++++++++++++++++++++++++++++++++++ statin/__init__.py | 0 conf.py => statin/conf.py | 0 statin => statin/statin.py | 4 +--- 10 files changed, 123 insertions(+), 5 deletions(-) rename LICENSE.txt => LICENSE (100%) create mode 100644 MANIFEST.in rename README.txt => README (69%) create mode 100755 run create mode 100755 script/statin create mode 100644 setup.py create mode 100644 statin/__init__.py rename conf.py => statin/conf.py (100%) rename statin => statin/statin.py (99%) mode change 100755 => 100644 diff --git a/.gitignore b/.gitignore index bee8a64..3e96b17 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ __pycache__ +dist +MANIFEST diff --git a/LICENSE.txt b/LICENSE similarity index 100% rename from LICENSE.txt rename to LICENSE diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..c41487f --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include README LICENSE diff --git a/README.txt b/README similarity index 69% rename from README.txt rename to README index 04201df..31aec8b 100644 --- a/README.txt +++ b/README @@ -11,8 +11,12 @@ deployment. Installation ============ -Clone the repository to your computer and add it to your path (optional). You -need to have Python 3 installed in order to use the script. +Download the package distribution and install it to your computer. You can +install the package with pip by running 'pip install statin.tar.gz'. You may +require superuser persmission to install the package. Alternatively you can +clone the repository to your computer and exucute the script named 'run'. + +You need to have Python 3 installed in order to use the script. Usage ===== @@ -22,6 +26,24 @@ extension ".shtml", ".shtm", or ".sht". After creating the website change directory to the document root of the site and run the script. By default the static site will be generated in a subdirectory named statin-output. +A number of command line options are also available. + +positional arguments: + files List of files to be processed + +optional arguments: + -h, --help show this help message and exit + -q, --quiet Suppress text output to console + -v, --verbose Verbose text output to console + -s, --safe Disable python eval of strings + -r, --recursive Process files recursively + -l LEVEL, --level LEVEL + Maximum recursion level + -p PATTERN, --pattern PATTERN + Filename patterns to be processed + -o OUTPUT, --output OUTPUT + Specify the output directory + Supported Directives ==================== diff --git a/run b/run new file mode 100755 index 0000000..0d4f9a3 --- /dev/null +++ b/run @@ -0,0 +1,25 @@ +#! /usr/bin/env python3 + +''' +Copyright (c) 2018 Agnibho Mondal +All rights reserved + +This file is part of Statin. + +Statin 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. + +Statin 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 Statin. If not, see . +''' + +import statin.statin + +statin.statin.main() diff --git a/script/statin b/script/statin new file mode 100755 index 0000000..0d4f9a3 --- /dev/null +++ b/script/statin @@ -0,0 +1,25 @@ +#! /usr/bin/env python3 + +''' +Copyright (c) 2018 Agnibho Mondal +All rights reserved + +This file is part of Statin. + +Statin 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. + +Statin 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 Statin. If not, see . +''' + +import statin.statin + +statin.statin.main() diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..ae59553 --- /dev/null +++ b/setup.py @@ -0,0 +1,45 @@ +#! /usr/bin/env python3 + +''' +Copyright (c) 2018 Agnibho Mondal +All rights reserved + +This file is part of Statin. + +Statin 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. + +Statin 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 Statin. If not, see . +''' + +from distutils.core import setup + +setup(name = "statin", + version = "1.0", + description = "Static html files generator", + author = "Agnibho Mondal", + author_email = "contact@agnibho.com", + url = "https://code.agnibho.com/statin/", + packages = ["statin"], + scripts = ["script/statin"], + long_description = "Statin is a static html files generator. It is compatible with SSI directives.", + classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: console", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", + "Natural Language :: English", + "Operating System :: POSIX", + "Operating System :: Unix", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Software Development :: Code Generators" + ] + ) diff --git a/statin/__init__.py b/statin/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/conf.py b/statin/conf.py similarity index 100% rename from conf.py rename to statin/conf.py diff --git a/statin b/statin/statin.py old mode 100755 new mode 100644 similarity index 99% rename from statin rename to statin/statin.py index 5b640f1..dcf097c --- a/statin +++ b/statin/statin.py @@ -1,5 +1,3 @@ -#! /usr/bin/python3 - ''' Copyright (c) 2018 Agnibho Mondal All rights reserved @@ -28,7 +26,7 @@ import argparse import re import tempfile -from conf import * +from statin.conf import * # Global variables conflist = {"timefmt": TIMEFMT, "sizefmt": SIZEFMT, "errmsg": ERRMSG} -- 2.39.5