diff --git a/VDM_API.egg-info/PKG-INFO b/VDM_API.egg-info/PKG-INFO deleted file mode 100644 index 352ff7b..0000000 --- a/VDM_API.egg-info/PKG-INFO +++ /dev/null @@ -1,60 +0,0 @@ -Metadata-Version: 1.1 -Name: VDM-API -Version: 1.1 -Summary: VDM API: an API for recover random VDM from vdm.fr website -Home-page: git://176.189.130.29/python/vdmAPI.git -Author: Antoine Roux -Author-email: antoinroux@hotmail.fr -License: Beerware -Download-URL: git://176.189.130.29/python/vdmAPI.git/tags -Description: ******* - VDM API - ******* - V1.0 - - **VDM API** is a python api for pull random api. - - Use case - ======== - You can use this API in python langage by instanciate a VDM() object : - :: - - from VDMAPI.VDM import VDM - - if __name__ == "__main__": - vdm = VDM() - lstAllVDM = vdm.get() - for i, vdm in enumerate(lstAllVDM): - print(str(i)+" : "+vdm) - - - Available GUI - ============= - - **VDM API** include four display mode : - - - **i3** : this GUI use dmenu for display the list of VDM - - **tkinter** : this use tkinter native interface - - **kivy** : use kivy library - - **console** : this last mode display the list of VDM in plain text mode - - Installing - ========== - - For **setup** you could do with this : - :: - - pip install --no-index --find-links= VDM_API - -Platform: any -Classifier: License :: FSF approved :: Beerware License -Classifier: Operating System :: POSIX :: Linux -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2.6 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.2 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Topic :: Software Development :: Libraries :: Python Modules diff --git a/VDM_API.egg-info/SOURCES.txt b/VDM_API.egg-info/SOURCES.txt deleted file mode 100644 index 946b9c3..0000000 --- a/VDM_API.egg-info/SOURCES.txt +++ /dev/null @@ -1,22 +0,0 @@ -MANIFEST.in -README.html -README.rst -setup.py -VDMAPI/HtmlParser.py -VDMAPI/VDM.py -VDMAPI/__init__.py -VDMAPI/version.py -VDMAPI/Display/__init__.py -VDMAPI/Display/console.py -VDMAPI/Display/i3.py -VDMAPI/Display/kivy.kv -VDMAPI/Display/kivyDisplay.py -VDMAPI/Display/pyside.py -VDMAPI/Display/tkinter.py -VDMAPI/Display/windows.py -VDMAPI/Display/wxpython.py -VDM_API.egg-info/PKG-INFO -VDM_API.egg-info/SOURCES.txt -VDM_API.egg-info/dependency_links.txt -VDM_API.egg-info/entry_points.txt -VDM_API.egg-info/top_level.txt \ No newline at end of file diff --git a/VDM_API.egg-info/dependency_links.txt b/VDM_API.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/VDM_API.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/VDM_API.egg-info/entry_points.txt b/VDM_API.egg-info/entry_points.txt deleted file mode 100644 index 6b89213..0000000 --- a/VDM_API.egg-info/entry_points.txt +++ /dev/null @@ -1,3 +0,0 @@ -[console_scripts] -vdm = VDMAPI:main - diff --git a/VDM_API.egg-info/top_level.txt b/VDM_API.egg-info/top_level.txt deleted file mode 100644 index b60ebbe..0000000 --- a/VDM_API.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -VDMAPI diff --git a/build/lib/VDMAPI/Display/__init__.py b/build/lib/VDMAPI/Display/__init__.py deleted file mode 100644 index 7bcea61..0000000 --- a/build/lib/VDMAPI/Display/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# import all module include into current package -__name__ = "VDMAPI" -__version__ = 1.0 -__author__ = "antoine roux" -__author_email__= "antoinroux@hotmail.fr" -__url__ = "antoine-roux.tk" -__description__ = "an api for recover a list of random vdm from vdm.fr and display it on different GUI (i3, tkinter, windows or commande line" diff --git a/build/lib/VDMAPI/Display/console.py b/build/lib/VDMAPI/Display/console.py deleted file mode 100644 index 7317811..0000000 --- a/build/lib/VDMAPI/Display/console.py +++ /dev/null @@ -1,12 +0,0 @@ -from ..VDM import VDM - -class console(object): - """display all vdm into console""" - def __init__(self): - super(console, self).__init__() - self.v = VDM() - - def render(self): - lstAllVDM = self.v.get() - for i, vdm in enumerate(lstAllVDM): - print(str(i)+" : "+vdm) diff --git a/build/lib/VDMAPI/Display/i3.py b/build/lib/VDMAPI/Display/i3.py deleted file mode 100644 index 9fb48b3..0000000 --- a/build/lib/VDMAPI/Display/i3.py +++ /dev/null @@ -1,20 +0,0 @@ -from ..VDM import VDM -import subprocess -import i3 - -class i3(object): - """display all vdm into i3 menu""" - def __init__(self): - super(i3, self).__init__() - self.v = VDM() - - def render(self): - lstAllVDM = self.v.get() - - dmenu = subprocess.Popen(['/usr/bin/dmenu', '-i','-l', str(len(lstAllVDM))], - stdin=subprocess.PIPE, - stdout=subprocess.PIPE) - - menu_str = '\n'.join(lstAllVDM) - win_str = dmenu.communicate(menu_str.encode('utf-8'))[0].decode('utf-8').rstrip() - print(win_str) \ No newline at end of file diff --git a/build/lib/VDMAPI/Display/kivy.kv b/build/lib/VDMAPI/Display/kivy.kv deleted file mode 100644 index 90b13c4..0000000 --- a/build/lib/VDMAPI/Display/kivy.kv +++ /dev/null @@ -1,23 +0,0 @@ -#:kivy 1.0 - -: - Button: - id: prev - - size_hint_x: None - width: 100 - - text: '<<' - on_press: root._prevAction() - Label: - text_size: 300, None - id: Message - text: 'no VDM load for the moment' - Button: - id: next - - size_hint_x: None - - width: 100 - text: '>>' - on_press: root._nextAction() \ No newline at end of file diff --git a/build/lib/VDMAPI/Display/kivyDisplay.py b/build/lib/VDMAPI/Display/kivyDisplay.py deleted file mode 100644 index 8a6b525..0000000 --- a/build/lib/VDMAPI/Display/kivyDisplay.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python - -from ..VDM import VDM -import os - -# get screen resolution -import tkinter -root = tkinter.Tk() -width = root.winfo_screenwidth() -height = root.winfo_screenheight() - -from kivy.config import Config -Config.set('graphics','fullscreen', 0) -Config.set('graphics','resizable',0) -Config.set('graphics','position', 'custom') -Config.set('graphics','width', 600) -Config.set('graphics','height', 150) - -# align bottom and 50 px from right -Config.set('graphics','left', width-Config.getint('graphics', 'width')-45) -Config.set('graphics','top', height-Config.getint('graphics', 'height')-17) - -from kivy.core.window import Window - -import kivy -from kivy.app import App -from kivy.properties import * -from kivy.uix.gridlayout import GridLayout - -class guiApp(GridLayout): - """ display all vdm into kivy interface """ - - # https://kivy.org/docs/api-kivy.properties.html#kivy.properties.ListProperty - # NumericProperty, StringProperty, ListProperty, ObjectProperty, - # BooleanProperty, BoundedNumericProperty, OptionProperty, ReferenceListProperty, AliasProperty, DictProperty - - indice = NumericProperty(0) - vdm = ListProperty([]) - - def __init__(self, **kwargs): - super(guiApp, self).__init__(**kwargs) - - self._keyboard = Window.request_keyboard(self._keyboard_closed, self) - self._keyboard.bind(on_key_down = self._on_keyboard_down) - - self.v = VDM() - self.vdm = self.v.get() - self.render() - - def _nextAction(self): - if self.indice == len(self.vdm)-1: - self.vdm = self.v.get() - self.indice = 0 - else: - self.indice += 1 - self.render() - - def _prevAction(self): - if self.indice > 0: - self.indice -= 1 - self.render() - - def _keyboard_closed(self): - self._keyboard.unbind(on_key_down = self._on_keyboard_down) - self._keyboard = None - - def _on_keyboard_down(self, *args): - if args[1][1] == 'right': - self._nextAction() - - elif args[1][1] == 'left': - self._prevAction() - - def render(self): - print(self.indice) - self.ids["Message"].text = self.vdm[self.indice] - -class kivyApp(App): - def build(self): - return guiApp(cols=3, pos=(0,0)) diff --git a/build/lib/VDMAPI/Display/pyside.py b/build/lib/VDMAPI/Display/pyside.py deleted file mode 100644 index 760e267..0000000 --- a/build/lib/VDMAPI/Display/pyside.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -import sys -import PySide - -app = QtGui.QApplication(sys.argv) - -hello = QtGui.QLabel("hello Qt") -hello.show() -x, y, w, h = 100, 100, 100, 100 -hello.setGeometry(x, y, w, h) - -sys.exit(app.exec_()) \ No newline at end of file diff --git a/build/lib/VDMAPI/Display/tkinter.py b/build/lib/VDMAPI/Display/tkinter.py deleted file mode 100644 index 0f8d2fe..0000000 --- a/build/lib/VDMAPI/Display/tkinter.py +++ /dev/null @@ -1,51 +0,0 @@ -from ..VDM import VDM -import tkinter as tk -import i3 -from tkinter import ttk -import os - -class tkinter: - def __init__(self): - """ init vdm object and create GUI """ - self.v = VDM() - self.indice = 0 - self.vdm = self.v.get() - - self.root = tk.Tk() - self.gui(self.root) - - def nextAction(self, event=None): - if self.indice == len(self.vdm)-1: - self.vdm = self.v.get() - self.indice = 0 - else: - self.indice+=1 - self.render() - - def prevAction(self, event=None): - if self.indice > 0: - self.indice-=1 - self.render() - - def gui(self, master): - self.mainwindow = ttk.Frame(master) - self.message = tk.Message(master, text="No VDM load for the moment", width="400") - - self.next = ttk.Button(master, text=">>", command=self.nextAction) - self.prev = ttk.Button(master, text="<<", command=self.prevAction) - self.root.bind('', self.prevAction) - self.root.bind('', self.nextAction) - - self.message.pack(fill="y", side="left", padx="5", pady="5") - self.prev.pack(fill="y", side="left", pady="1") - self.next.pack(fill="y", side="right", pady="1") - - def _floatingDisabler(self): - i3.msg("command", "floating enable") - - def render(self): - print("indice {}".format(self.indice)) - - self.message.configure(text=self.vdm[self.indice]) - self.root.after(1, self._floatingDisabler) - self.root.mainloop() diff --git a/build/lib/VDMAPI/Display/windows.py b/build/lib/VDMAPI/Display/windows.py deleted file mode 100644 index 8974669..0000000 --- a/build/lib/VDMAPI/Display/windows.py +++ /dev/null @@ -1,12 +0,0 @@ -from ..VDM import VDM - -class windows(object): - """display all vdm into windows os""" - def __init__(self): - super(windows, self).__init__() - v = VDM() - - def render(self): - lstAllVDM = self.v.get() - for i, vdm in enumerate(lstAllVDM): - print(str(i)+" : "+vdm) \ No newline at end of file diff --git a/build/lib/VDMAPI/Display/wxpython.py b/build/lib/VDMAPI/Display/wxpython.py deleted file mode 100644 index 684c194..0000000 --- a/build/lib/VDMAPI/Display/wxpython.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/python - -import wx - -def onButton(event): - print "Button pressed." - -app = wx.App() -frame = wx.Frame(None, -1, 'win.py') -frame.SetDimensions(0,0,200,50) - -panel = wx.Panel(frame, wx.ID_ANY) -button = wx.Button(panel, wx.ID_ANY, 'Test', (10, 10)) -button.Bind(wx.EVT_BUTTON, onButton) - -frame.Show() -frame.Centre() -app.MainLoop() \ No newline at end of file diff --git a/build/lib/VDMAPI/HtmlParser.py b/build/lib/VDMAPI/HtmlParser.py deleted file mode 100644 index c03a52d..0000000 --- a/build/lib/VDMAPI/HtmlParser.py +++ /dev/null @@ -1,26 +0,0 @@ -from html.parser import HTMLParser -from html.entities import name2codepoint - -class MyHTMLParser(HTMLParser): - def __init__(self): - super(MyHTMLParser, self).__init__() - self.vdm = [] - self.save = False - - def _searchClass(self, listTuple, className="post article"): - for v in listTuple: - if v[0] == 'class' and v[1] == className: - return True - return False - - def handle_starttag(self, tag, attrs): - if tag == "p" and self._searchClass(attrs, className="content"): - self.save = True - - def handle_data(self, data): - if self.save: - self.vdm.append(data) - self.save = False - - def getText(self): - return self.vdm \ No newline at end of file diff --git a/build/lib/VDMAPI/VDM.py b/build/lib/VDMAPI/VDM.py deleted file mode 100644 index 9717016..0000000 --- a/build/lib/VDMAPI/VDM.py +++ /dev/null @@ -1,36 +0,0 @@ -from .HtmlParser import MyHTMLParser -import requests - -class VDM(object): - """VDM module for recover random VDM""" - - def __init__(self): - self.url = "http://www.viedemerde.fr/aleatoire" - self.vdm = {} - - def get(self): - try: - r = requests.get(self.url) - r.encoding = 'utf-8' # ISO-8859-1 - - if(r.status_code == requests.codes.ok): - parser = MyHTMLParser() - parser.feed(r.text) - self.vdm = parser.getText() - - print("Sucess {}".format(r.status_code)) - - return self.vdm - else: - print("Error {}".format(r.status_code)) - - except requests.exceptions.ConnectionError as e: - raise errorVDM("network error") - - except HTTPError as e: - raise errorVDM("HTTP Error") - -class errorVDM(Exception): - def __init__(self, message): - super(errorVDM, self).__init__(message) - \ No newline at end of file diff --git a/build/lib/VDMAPI/__init__.py b/build/lib/VDMAPI/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/build/lib/VDMAPI/version.py b/build/lib/VDMAPI/version.py deleted file mode 100644 index e6956dc..0000000 --- a/build/lib/VDMAPI/version.py +++ /dev/null @@ -1 +0,0 @@ -version = '1.1'