Commit 203709fc by Luciano Barletta

Added enums classification, not tested

1 parent e7682beb
import sqlite3 import sqlite3
from enums import Table, States, Services, Datatypes
class Table:
id = "id"
file = "file"
serv = "serv"
dest = "dest"
type = "type"
state = "state"
class States:
queued = "queued"
delivered = "delivered"
class DBconnection: class DBconnection:
......
class Table:
id = "id"
file = "file"
serv = "serv"
dest = "dest"
type = "type"
state = "state"
class States:
queued = "queued"
delivered = "delivered"
class Services:
wpp1 = "wpp1"
@staticmethod
def validate(serv):
if serv == Services.wpp1:
return True
return False
class Datatypes:
text = "text"
image = "image"
document = "document"
link = "link"
@staticmethod
def validate(datatype):
if datatype == Datatypes.text:
return True
if datatype == Datatypes.image:
return True
if datatype == Datatypes.document:
return True
if datatype == Datatypes.link:
return True
return False
import ipdb import ipdb
import os import os
from services import serviceFactory, Datatypes, Services from services import serviceFactory
from database import DBconnection, Table, States from database import DBconnection
from enums import Services, States, Datatypes, Table
class Process: class Process:
......
import requests import requests
import json import json
import os import os
from database import Table from enums import Table, Services, States, Datatypes
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
class Services:
wpp1 = "wpp1"
@staticmethod
def validate(serv):
if serv == Services.wpp1:
return True
return False
# move this to be more accessible, everything needs to use it...
# or perhaps I can work around it
class Datatypes:
text = "text"
image = "image"
document = "document"
link = "link"
@staticmethod
def validate(datatype):
if datatype == Datatypes.text:
return True
if datatype == Datatypes.image:
return True
if datatype == Datatypes.document:
return True
if datatype == Datatypes.link:
return True
return False
class ServiceBase(ABC): class ServiceBase(ABC):
@abstractmethod @abstractmethod
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!