working TSV and SWP and modules
This commit is contained in:
@@ -1 +1 @@
|
|||||||
../web/SimpleWebPage.py
|
../py-packages/SimpleWebPage/simplewebpage/__init__.py
|
||||||
25
py-packages/Makefile
Normal file
25
py-packages/Makefile
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
.PHONY: help
|
||||||
|
|
||||||
|
help: ## *:・゚✧*:・゚✧ This help *:・゚✧*:・゚✧
|
||||||
|
@printf "\033[36;1m %14s \033[0;32;1m %s\033[0m\n" Target Description
|
||||||
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
|
||||||
|
awk ' \
|
||||||
|
BEGIN {FS = ":.*?## "}; \
|
||||||
|
{ if ( $$1 != "-") { \
|
||||||
|
printf "\033[31;1;40m[ \033[36;1;40m%14s \033[31;1;40m]\033[0;32;1m %s\033[0m\n", $$1, $$2 \
|
||||||
|
} else { \
|
||||||
|
printf " \033[0;33;1m=^= %-25s =^=\033[0m\n", $$2 \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
'
|
||||||
|
|
||||||
|
clean: ## Clean build and .egg folder in py modules
|
||||||
|
rm -vr */build/ */*.egg-info
|
||||||
|
|
||||||
|
|
||||||
|
pipx: ## Install all packages with pipx
|
||||||
|
for module in *; do if [[ -f $module/setup.py ]]; then pipx install $module; fi; done
|
||||||
|
|
||||||
|
|
||||||
|
foo:
|
||||||
|
pass
|
||||||
25
py-packages/SimpleWebPage/setup.py
Normal file
25
py-packages/SimpleWebPage/setup.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
from distutils.core import setup
|
||||||
|
|
||||||
|
def version_reader(path):
|
||||||
|
for line in open(path,"rt").read(1024).split("\n"):
|
||||||
|
if line.startswith("VERSION"):
|
||||||
|
return line.split("=")[1].strip().replace('"',"")
|
||||||
|
|
||||||
|
version = version_reader(os.path.join("simplewebpage","__init__.py"))
|
||||||
|
setup(
|
||||||
|
name="SimpleWebPage",
|
||||||
|
packages=["simplewebpage"],
|
||||||
|
version=version,
|
||||||
|
description="HTML file index generator.",
|
||||||
|
author="Ville Rantanen",
|
||||||
|
author_email="ville.q.rantanen@gmail.com",
|
||||||
|
keywords=["HTML", "generator"],
|
||||||
|
entry_points={
|
||||||
|
"console_scripts": [
|
||||||
|
"SimpleWebPage=simplewebpage:main",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
install_requires = [
|
||||||
|
'markdown>=3.3.4'
|
||||||
|
]
|
||||||
|
)
|
||||||
@@ -1006,7 +1006,9 @@ def sizeof(num):
|
|||||||
return "%3.1f %s" % (num, x)
|
return "%3.1f %s" % (num, x)
|
||||||
num /= 1024.0
|
num /= 1024.0
|
||||||
|
|
||||||
|
def main():
|
||||||
if __name__ == "__main__":
|
|
||||||
opts = setup()
|
opts = setup()
|
||||||
generate_index(opts)
|
generate_index(opts)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -4,6 +4,8 @@ import os
|
|||||||
import re
|
import re
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
|
__version__ = "1.0"
|
||||||
|
|
||||||
|
|
||||||
class TSVFilter:
|
class TSVFilter:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -16,6 +18,8 @@ class TSVFilter:
|
|||||||
def get_options(self):
|
def get_options(self):
|
||||||
|
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
|
# ~ parser.add_argument('--version', action='version', version=open(os.path.join(os.path.dirname(__file__),"VERSION"), "rt").read())
|
||||||
|
parser.add_argument("--version", action="version", version=__version__)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-f",
|
"-f",
|
||||||
action="store",
|
action="store",
|
||||||
24
py-packages/TSVFilter/setup.py
Normal file
24
py-packages/TSVFilter/setup.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
from distutils.core import setup
|
||||||
|
|
||||||
|
|
||||||
|
def version_reader(path):
|
||||||
|
for line in open(path, "rt").read(1024).split("\n"):
|
||||||
|
if line.startswith("__version__"):
|
||||||
|
return line.split("=")[1].strip().replace('"', "")
|
||||||
|
|
||||||
|
|
||||||
|
version = version_reader(os.path.join("TSVFilter", "filter.py"))
|
||||||
|
setup(
|
||||||
|
name="TSVFilter",
|
||||||
|
packages=["TSVFilter"],
|
||||||
|
version=version,
|
||||||
|
description="TSV column filter.",
|
||||||
|
author="Ville Rantanen",
|
||||||
|
author_email="ville.q.rantanen@gmail.com",
|
||||||
|
keywords=["TSV", "data"],
|
||||||
|
entry_points={
|
||||||
|
"console_scripts": [
|
||||||
|
"TSVFilter=TSVFilter:main",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
)
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
from distutils.core import setup
|
|
||||||
setup(
|
|
||||||
name = 'TSVFilter',
|
|
||||||
packages = ['TSVFilter'],
|
|
||||||
version = '1.0',
|
|
||||||
description = 'TSV column filter.',
|
|
||||||
author = 'Ville Rantanen',
|
|
||||||
author_email = 'ville.q.rantanen@gmail.com',
|
|
||||||
keywords = ['TSV', 'data'],
|
|
||||||
entry_points = {
|
|
||||||
"console_scripts": [
|
|
||||||
"TSVFilter=TSVFilter:main",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
)
|
|
||||||
Reference in New Issue
Block a user