(self, curs, log = None)
Create a dbobject.
Create a dbobject.
Create a dbobject .
def create(self, curs, log = None):
        """Create a dbobject."""
        if log:
            log.info('Installing %s' % self.name)
        if self.sql:
            sql = self.sql
        elif self.sql_file:
            fn = self.find_file()
            if log:
                log.info("  Reading from %s" % fn)
            sql = open(fn, "r").read()
        else:
            raise Exception('object not defined')
        for stmt in skytools.parse_statements(sql):
            #if log: log.debug(repr(stmt))
            curs.execute(stmt)
def create ( self , curs , log = None ) : if log : log . info ( 'Installing %s' % self . name ) if self . sql : sql = self . sql elif self . sql_file : fn = self . find_file ( ) if log : log . info ( "  Reading from %s" % fn ) sql = open ( fn , "r" ) . read ( ) else : raise Exception ( 'object not defined' ) for stmt in skytools . parse_statements ( sql ) : #if log: log.debug(repr(stmt)) curs . execute ( stmt )