swich Modul und ems Modul hinzugefügt
This commit is contained in:
parent
5df7ae564a
commit
9a99cf1e7a
2 changed files with 57 additions and 0 deletions
12
scr/ems.py
Normal file
12
scr/ems.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
'''
|
||||
Created on 15.11.2013
|
||||
|
||||
@author: Philipp Rauch
|
||||
@version: 0.01
|
||||
'''
|
||||
import threading
|
||||
import Queue
|
||||
import swich
|
||||
from API import Buffer as buf
|
||||
|
||||
foo = swich.Swich(swich.MYSQL)
|
||||
45
scr/swich.py
Normal file
45
scr/swich.py
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
'''
|
||||
Created on 15.11.2013
|
||||
|
||||
@author: Philipp Rauch
|
||||
@version: 0.01
|
||||
'''
|
||||
|
||||
import MySQLdb
|
||||
import threading
|
||||
import Queue
|
||||
|
||||
MYSQL = 0
|
||||
CSV = 1
|
||||
XML = 2
|
||||
JSON = 3
|
||||
|
||||
class Swich(object):
|
||||
def __init__(self, source):
|
||||
self.source = source
|
||||
|
||||
def start(self):
|
||||
if self.source == MYSQL:
|
||||
# @TODO CANFilter starten
|
||||
self.connection = MySQLdb.connect("url", "user", "passwort", "datenbankname")
|
||||
self.cursor = self.connection.cursor()
|
||||
self.queue = self.__createQueue__()
|
||||
return self.queue
|
||||
elif self.source ==CSV:
|
||||
pass
|
||||
elif self.source == XML:
|
||||
pass
|
||||
elif self.source == JSON:
|
||||
pass
|
||||
else:
|
||||
return
|
||||
def __createQueue__(self):
|
||||
return
|
||||
|
||||
def setQueue(self):
|
||||
pass
|
||||
|
||||
def getQueue(self):
|
||||
pass
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue