Commit 243b21ac authored by Yori's avatar Yori
Browse files

pre-cleaning for the install method

parent 36ede192
from .mpl_data import MplData
# TECHNICAL ------------------------------------------------------------
D_VERSION='v5'
CONTEXT='CLIENT'
D_HOST='localhost'
D_PORT=50803
# FORM -----------------------------------------------------------------
INFO = " > info-: "
WARN = " > warn-: "
SEVR = " > sevr-: "
DBUG = " > dbug-: "
SPCE = " > -----: "
# CONFIGURATION --------------------------------------------------------
# myFig
D_FIGNUM = 0 # default figure number
D_FIGSIZE = (8., 6.) # default figure size
D_REFORMAT = True # default reformat value
D_FORMATTED = False # default formatted value
D_INPUTARG = 'current' # default Input argument
# myIOs
D_IPATH = '../' # default path to project
# print2file
D_OPATH = 'myplotlib/img/' # default path to ouput
D_OFORMAT = 'png' # default format for ouput
# Debug
D_DEBUG = True # default debug value
from .mpl_data import MplData
# TECHNICAL ------------------------------------------------------------
D_VERSION='v5'
CONTEXT='LOCAL'
D_HOST='localhost'
D_PORT=50803
# FORM -----------------------------------------------------------------
INFO = " > info-: "
WARN = " > warn-: "
SEVR = " > sevr-: "
DBUG = " > dbug-: "
SPCE = " > -----: "
# CONFIGURATION --------------------------------------------------------
# myFig
D_FIGNUM = 0 # default figure number
D_FIGSIZE = (8., 6.) # default figure size
D_REFORMAT = True # default reformat value
D_FORMATTED = False # default formatted value
D_INPUTARG = 'current' # default Input argument
# myIOs
D_IPATH = '../' # default path to project
# print2file
D_OPATH = 'myplotlib/img/' # default path to ouput
D_OFORMAT = 'png' # default format for ouput
# Debug
D_DEBUG = True # default debug value
from .mpl_data import MplData
# TECHNICAL ------------------------------------------------------------
D_VERSION='v5'
CONTEXT='server'
D_HOST='localhost'
D_PORT=50803
# FORM -----------------------------------------------------------------
INFO = " > info-: "
WARN = " > warn-: "
SEVR = " > sevr-: "
DBUG = " > dbug-: "
SPCE = " > -----: "
# CONFIGURATION --------------------------------------------------------
# myFig
D_FIGNUM = 0 # default figure number
D_FIGSIZE = (8., 6.) # default figure size
D_REFORMAT = True # default reformat value
D_FORMATTED = False # default formatted value
D_INPUTARG = 'current' # default Input argument
# myIOs
D_IPATH = '../' # default path to project
# print2file
D_OPATH = 'myplotlib/img/' # default path to ouput
D_OFORMAT = 'png' # default format for ouput
# Debug
D_DEBUG = True # default debug value
class Signal (object):
def __init__(self, content):
# every signal should have a content attribute
self.content = content
class Query(Signal):
READDATA = 1
NEWSYNCFIGURE = 2
UPDATESYNCFIGURE = 3
SYNCFIGFORMATRAWDATA = 4
DELETESYNCFIGURE = 5
LISTDATA = 6
GETDATA = 7
LISTFIG = 8
MERGEDATA = 9
NBR_OF_QUERY_TYPES = 9
def __init__(self, query_type, content):
if query_type in range(1, Query.NBR_OF_QUERY_TYPES + 1):
self.query_type = query_type
if query_type == Query.READDATA:
if isinstance(content, dict):
self.content = content
else:
print('parameter 2 of Query constructor is '
'expected to be of type dict')
raise(UserWarning)
elif query_type == Query.NEWSYNCFIGURE:
if isinstance(content, dict):
self.content = content
else:
print('parameter 2 of Query constructor is '
'expected to be of type dict')
raise(UserWarning)
elif query_type == Query.UPDATESYNCFIGURE:
self.content = content
elif query_type == Query.SYNCFIGFORMATRAWDATA:
self.content = content
elif query_type == Query.DELETESYNCFIGURE:
self.content = content
elif query_type == Query.LISTDATA:
self.content = content
elif query_type == Query.GETDATA:
self.content = content
elif query_type == Query.LISTFIG:
self.content = content
elif query_type == Query.MERGEDATA:
self.content = content
else:
print('unknown query type!')
raise UserWarning
class Status(Signal):
def __init__(self, value, error):
if value in [True, False]:
self.value = value
else:
print('value parameter of a status signal'
' can only be True or False!')
raise UserWarning
if (isinstance(error, str)):
self.content = error
else:
print('error parameter of a status signal'
'can only be of type string!')
raise UserWarning
class Answer(Signal):
pass
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment