modfication de setup.py pour permettre d'avoir la commande vdm fonctionnel dans /bin

This commit is contained in:
antoine 2017-01-11 00:37:54 +01:00
parent 3881cda577
commit 51d120df26
15 changed files with 36 additions and 10 deletions

BIN
VDMAPI/Display/__init__.pyc Normal file

Binary file not shown.

View File

@ -9,4 +9,4 @@ class console(object):
def render(self): def render(self):
lstAllVDM = self.v.get() lstAllVDM = self.v.get()
for i, vdm in enumerate(lstAllVDM): for i, vdm in enumerate(lstAllVDM):
print(str(i)+" : "+vdm) print(str(i)+" : "+vdm.strip())

BIN
VDMAPI/Display/console.pyc Normal file

Binary file not shown.

BIN
VDMAPI/Display/i3.pyc Normal file

Binary file not shown.

Binary file not shown.

BIN
VDMAPI/Display/tkinter.pyc Normal file

Binary file not shown.

View File

@ -5,7 +5,7 @@ class MyHTMLParser(HTMLParser):
def __init__(self): def __init__(self):
super(MyHTMLParser, self).__init__() super(MyHTMLParser, self).__init__()
self.vdm = [] self.vdm = []
self.save = False self.save = 0
def _searchClass(self, listTuple, className="post article"): def _searchClass(self, listTuple, className="post article"):
for v in listTuple: for v in listTuple:
@ -14,13 +14,16 @@ class MyHTMLParser(HTMLParser):
return False return False
def handle_starttag(self, tag, attrs): def handle_starttag(self, tag, attrs):
if tag == "p" and self._searchClass(attrs, className="content"): if tag == "p" and self._searchClass(attrs, className="block"):
self.save = True self.save = 1
if tag == "a" and self.save == 1:
self.save = 2
def handle_data(self, data): def handle_data(self, data):
if self.save: if self.save == 2:
self.vdm.append(data) self.vdm.append(data.strip())
self.save = False self.save = 0
def getText(self): def getText(self):
return self.vdm return self.vdm

14
VDMAPI/__main__.py Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from VDMAPI.VDM import VDM
def main():
for i, vdm in enumerate(VDM().get()):
print(str(i)+" : "+vdm.strip())
if __name__ == '__main__':
main()

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
dist/VDM_API-1.1-py3-none-any.whl vendored Normal file

Binary file not shown.

7
generateWheel.md Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
pip uninstall VDM-API
pip wheel --wheel-dir=dist ./
pip install dist/VDM_API-1.1-py3-none-any.whl
# python setup.py sdist generate tar.gz archive setupable with pip

View File

@ -37,7 +37,7 @@ setup(
install_requires=[], install_requires=[],
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'vdm = VDMAPI:main', 'vdm = VDMAPI.__main__:main',
] ]
}, },
classifiers=[ classifiers=[
@ -51,5 +51,7 @@ setup(
'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Libraries :: Python Modules',
], ) ]
)