Update readme and setup.py

parent a4591309
## Redirector # Redirector
Installation: Installation:
`$ python3 setup.py install` `$ python3 setup.py install`
...@@ -9,13 +9,15 @@ Usage: ...@@ -9,13 +9,15 @@ Usage:
`$ redirector-watch <file-to-watch>` - set inotify watchdog for this file and renew .map and .conf files for this project when file content is changed `$ redirector-watch <file-to-watch>` - set inotify watchdog for this file and renew .map and .conf files for this project when file content is changed
`$ redirector-convert <.htaccess file> <.map file>` - convert .htaccess to .map file
## Structure ## Structure
#### Redirector: ### Redirector:
`dev/redirector.py:` **Redirector** - main class with single function - **generate(**_yaml_file, map_file_**)**, that generates _.conf_ and _.map_ files in _MAPS_DIR_ and _CONFIG_DIR_ directories, specified in `dev/const.py` `redirector/redirector.py:` **Redirector** - main class with single function - **generate(**_yaml_file, map_file_**)**, that generates _.conf_ and _.map_ files in _MAPS_DIR_ and _CONFIG_DIR_ directories, specified in `redirector/const.py`
`dev/generators.py:` **Generator** - class, that uses **MapGenerator** and **ConfigGenerator** for creating _.map_ and _.conf_ files. `redirector/generators.py:` **Generator** - class, that uses **MapGenerator** and **ConfigGenerator** for creating _.map_ and _.conf_ files.
File `dev/parser.py` consists of: **MapLineParser** and **ConfigReader**. File `redirector/parser.py` consists of: **MapLineParser** and **ConfigReader**.
**MapLineParser.parse_line** reads a line from _.yaml_ file and returns a list of arguments with _return_code_ that specifies line type. **MapLineParser.parse_line** reads a line from _.yaml_ file and returns a list of arguments with _return_code_ that specifies line type.
**ConfigReader.parse_map** reads _.map_ file and returns list of default redirects and _dict_ with error_code as _key_ and list of redirects with this specific code as _value_. **ConfigReader.parse_map** reads _.map_ file and returns list of default redirects and _dict_ with error_code as _key_ and list of redirects with this specific code as _value_.
...@@ -23,6 +25,8 @@ Usage: ...@@ -23,6 +25,8 @@ Usage:
**ConfigReader.parse_yaml** reads _.yaml_ file and return list of tuples (<_path to .map_file_>, <_project_name_>) **ConfigReader.parse_yaml** reads _.yaml_ file and return list of tuples (<_path to .map_file_>, <_project_name_>)
#### RedirectorWatch: ### RedirectorWatch:
**RedirectorWatch** - main class with main function **watch(**_yaml_file_**)** that sets ThreadedNotifier for _.yaml_ file that looks for changes, and starts `Redirector.generate()` any time file is changed. **RedirectorWatch** - main class with main function **watch(**_yaml_file_**)** that sets ThreadedNotifier for _.yaml_ file that looks for changes, and starts `Redirector.generate()` any time file is changed.
### RedirectorConvert:
**HtaccessParser** - class for parse and convert .htaccess data. **HtaccessReader** - class for read data from .htaccess and write this to new .map file.
import os import os
from setuptools import setup, find_packages from setuptools import setup, find_packages
from dev import const from redirector import const
classifiers_list = [ classifiers_list = [
"Development Status :: 4 - Beta", "Development Status :: 4 - Beta",
...@@ -20,12 +20,13 @@ classifiers_list = [ ...@@ -20,12 +20,13 @@ classifiers_list = [
setup( setup(
name=const.NAME, name=const.NAME,
version="0.1", version="0.2",
packages=find_packages(), packages=find_packages(),
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'redirector = dev.redirector:main', 'redirector = redirector.redirector:main',
'redirector-watch = dev.redirector:watch' 'redirector-watch = redirector.watcher:watch',
'redirector-convert = redirector.htaccess_parser:main'
] ]
}, },
classifiers=classifiers_list classifiers=classifiers_list
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment