def __init__(self, doc, uri): # create the C object self.ptr = libsbol.createDNASequence(doc.ptr, uri) if self.ptr == None: raise URIError("Duplicate URI '%s'" % uri) # register the Python proxy self.doc = doc self.doc._sequences.append(self)
def __init__(self, doc, uri, ptr=None): ## The SWIGPython-libSBOLc object wrapped by this DNASequence object self.ptr = None if not ptr: # create the C object if it doesn't exist already self.ptr = libsbol.createDNASequence(doc.ptr, uri) else: # wrap a C object if it already exists, necessary for input from file self.ptr = ptr if self.ptr == None: raise URIError("Duplicate URI '%s'" % uri) # register the Python proxy ## the Document to which this sequence object belongs self.doc = doc self.doc._sequences.append(self)