Commit 203709fc by Luciano Barletta

Added enums classification, not tested

1 parent e7682beb
import sqlite3
class Table:
id = "id"
file = "file"
serv = "serv"
dest = "dest"
type = "type"
state = "state"
class States:
queued = "queued"
delivered = "delivered"
from enums import Table, States, Services, Datatypes
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 os
from services import serviceFactory, Datatypes, Services
from database import DBconnection, Table, States
from services import serviceFactory
from database import DBconnection
from enums import Services, States, Datatypes, Table
class Process:
......
import requests
import json
import os
from database import Table
from enums import Table, Services, States, Datatypes
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):
@abstractmethod
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!