def maintest(): 'test main program' from cmainit import CMAinit from droneinfo import Drone from systemnode import SystemNode print >> sys.stderr, 'Starting' CMAinit(None, cleanoutdb=True, debug=True) if CMAdb.store.transaction_pending: print 'Transaction pending in:', CMAdb.store print 'Results:', CMAdb.store.commit() print ProcessNode.__meta_labels__() print SystemNode.__meta_labels__() print Drone.__meta_labels__() print 'keys:', Drone.__meta_keyattrs__() print >> sys.stderr, 'Init done' return 0
'Iterate over self.keys() - giving the names of all our *top level* attributes.' for key in self.keys(): yield key def __contains__(self, key): return key in self.map() def __len__(self): return len(self.map()) @staticmethod def __meta_keyattrs__(): 'Return our key attributes in order of significance' return ['jhash'] if __name__ == '__main__': from cmainit import CMAinit print >> sys.stderr, 'Starting' CMAinit(None, cleanoutdb=True, debug=True) if CMAdb.store.transaction_pending: print 'Transaction pending in:', CMAdb.store print 'Results:', CMAdb.store.commit() print CMAclass.__meta_labels__() print ProcessNode.__meta_labels__() print SystemNode.__meta_labels__() from droneinfo import Drone print Drone.__meta_labels__() print 'keys:', Drone.__meta_keyattrs__() print >> sys.stderr, 'Init done'
'Delete a role from our GraphNode' if isinstance(roles, tuple) or isinstance(roles, list): for role in roles: self.delrole(role) return self.roles assert isinstance(roles, str) or isinstance(roles, unicode) if roles in self.roles: self.roles.remove(roles) return self.roles @staticmethod def __meta_keyattrs__(): 'Return our key attributes in order of significance' return ['processname', 'domain'] if __name__ == '__main__': from cmainit import CMAinit from cmadb import CMAdb print >> sys.stderr, 'Starting' CMAinit(None, cleanoutdb=True, debug=True) if CMAdb.store.transaction_pending: print 'Transaction pending in:', CMAdb.store print 'Results:', CMAdb.store.commit() print CMAclass.__meta_labels__() print ProcessNode.__meta_labels__() print SystemNode.__meta_labels__() from droneinfo import Drone print Drone.__meta_labels__() print 'keys:', Drone.__meta_keyattrs__() print >> sys.stderr, 'Init done'