added formatting

This commit is contained in:
Ville Rantanen
2021-11-16 11:20:30 +02:00
parent b282598b05
commit 17f281a501
6 changed files with 42 additions and 35 deletions

View File

@@ -21,9 +21,11 @@ clean: ## Clean build and .egg folder in py modules
pipx: ## Install all packages with pipx pipx: ## Install all packages with pipx
for module in *; do if [ -f $$module/setup.py ]; then pipx install $$module; fi; done for module in *; do if [ -f $$module/setup.py ]; then pipx install $$module; fi; done
format: ## Reformat packages with black
black SimpleWebPage/
black TSVFilter/
black markslider/
packages: clean ## Create packages for every module
for module in *; do if [ -f $$module/setup.py ]; then tar czf $$module.tgz $$module; fi; done
tar-SimpleWebPage: clean ## Create package for SimpleWebPage tar-SimpleWebPage: clean ## Create package for SimpleWebPage
tar czf SimpleWebPage.tgz SimpleWebPage/ tar czf SimpleWebPage.tgz SimpleWebPage/

View File

@@ -1,10 +1,12 @@
from distutils.core import setup from distutils.core import setup
def version_reader(path): def version_reader(path):
for line in open(path, "rt").read(1024).split("\n"): for line in open(path, "rt").read(1024).split("\n"):
if line.startswith("VERSION"): if line.startswith("VERSION"):
return line.split("=")[1].strip().replace('"', "") return line.split("=")[1].strip().replace('"', "")
version = version_reader(os.path.join("simplewebpage", "__init__.py")) version = version_reader(os.path.join("simplewebpage", "__init__.py"))
setup( setup(
name="SimpleWebPage", name="SimpleWebPage",
@@ -19,7 +21,5 @@ setup(
"SimpleWebPage=simplewebpage:main", "SimpleWebPage=simplewebpage:main",
], ],
}, },
install_requires = [ install_requires=["markdown>=3.3.4"],
'markdown>=3.3.4'
]
) )

View File

@@ -28,6 +28,7 @@ import traceback, tty, termios, subprocess, signal
sys.path.append(os.path.dirname(os.path.realpath(__file__))) sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import ansicodes, md_color import ansicodes, md_color
try: try:
import climage import climage
except ImportError: except ImportError:
@@ -278,7 +279,13 @@ class slide_reader:
width = max(5, self.scrsize[1] - 10) width = max(5, self.scrsize[1] - 10)
output = climage.convert( output = climage.convert(
image.group(3), image.group(3),
is_unicode=True, is_truecolor=True, is_256color=False, is_16color=False, is_8color=False, width=width, palette="default" is_unicode=True,
is_truecolor=True,
is_256color=False,
is_16color=False,
is_8color=False,
width=width,
palette="default",
) )
output = output.split("\n") output = output.split("\n")
while len(output[0].strip()) == 0: while len(output[0].strip()) == 0:

View File

@@ -16,8 +16,6 @@ setup(
author="Ville Rantanen", author="Ville Rantanen",
author_email="ville.q.rantanen@gmail.com", author_email="ville.q.rantanen@gmail.com",
keywords=["Markdown", "Slideshow"], keywords=["Markdown", "Slideshow"],
entry_points = {'console_scripts': 'markslider = markslider.markslider:main'}, entry_points={"console_scripts": "markslider = markslider.markslider:main"},
install_requires = [ install_requires=["pygments", "climage"],
'pygments', 'climage'
]
) )