Skip to content
Snippets Groups Projects
Commit 2515570b authored by juanf's avatar juanf
Browse files

Antibody Type (ongoing work)

SVN: 32917
parent a0f999a2
No related branches found
No related tags found
No related merge requests found
......@@ -2,5 +2,72 @@
import sys
import definitions
##
## Generic Adaptor Pattern
##
class EntityAdaptor:
entities = None
entitiesIdx = None
def init(self):
self.entities = [];
self.entitiesIdx = -1;
pass
def next(self):
if self.entities is None and self.entitiesIdx is None:
self.init()
self.entitiesIdx += 1
if len(self.entities) < self.entitiesIdx:
return True
else:
return False
def getEntity(self):
return self.entities[self.entitiesIdx]
class DTO:
values = {}
openBISTransaction = None
def __init__(self, values, openBISTransaction):
self.values = values
self.openBISTransaction = openBISTransaction
def isInOpenBIS(self):
pass
def write(self):
pass
##
## Costumer specific logic
##
class FileMakerEntityAdaptor(EntityAdaptor):
fileMakerConnString = None
fileMakerUser = None
fileMakerPass = None
def __init__(self, fileMakerConnString, fileMakerUser, fileMakerPass):
self.fileMakerConnString = fileMakerConnString
self.fileMakerUser = fileMakerUser
self.fileMakerPass = fileMakerPass
class AntibodyAdaptor(FileMakerEntityAdaptor):
def init(self):
self.entities = [];
self.entitiesIdx = -1;
pass
adaptors = [AntibodyAdaptor(None, None, None)]
##
## Generic Process Method
##
def process(tr):
print "ALIVE!"
\ No newline at end of file
for adaptor in adaptors:
if adaptor.next():
entity = adaptor.getEntity()
if not entity.isInOpenBIS():
entity.write()
print "FINISH!"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment