# Public License, V2.0, GNU Lesser General Public License, V2.1 # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://kamaelia.sourceforge.net/AUTHORS - please extend this file, # not this notice. # (2) Reproduced in the COPYING file, and at: # http://kamaelia.sourceforge.net/COPYING # Under section 3.5 of the MPL, we are using this text since we deem the MPL # notice inappropriate for this file. As per MPL/GPL/LGPL removal of this # notice is prohibited. # # Please contact us via: [email protected] # to discuss alternative licensing. # ------------------------------------------------------------------------- # """ A commandline tool that creates users and creates user configuration files. This configuration file is used by KPIClient """ from Kamaelia.Community.AM.Kamaelia.KPIFramework.KPI.DB import LKH import sys if __name__ == '__main__': if len(sys.argv) < 3: print "usage:", sys.argv[0], "dbfile usercfg1 [usercfg2].. " sys.exit(1) dbfile = sys.argv[1] for index in range(2, len(sys.argv)): LKH.createUser(dbfile, sys.argv[index])
# not this notice. # (2) Reproduced in the COPYING file, and at: # http://kamaelia.sourceforge.net/COPYING # Under section 3.5 of the MPL, we are using this text since we deem the MPL # notice inappropriate for this file. As per MPL/GPL/LGPL removal of this # notice is prohibited. # # Please contact us via: [email protected] # to discuss alternative licensing. # ------------------------------------------------------------------------- # """ A commandline tool that prints the user configuration given user id """ from Kamaelia.Community.AM.Kamaelia.KPIFramework.KPI.DB import LKH import sys if __name__ == '__main__': if len(sys.argv) < 3: print "usage:", sys.argv[0], "dbfile userid" sys.exit(1) dbfile = sys.argv[1] userid = long(sys.argv[2]) if userid < 1 : print "userid", argv[2], "is invalid\n" sys.exit(1) LKH.getUserConfig(dbfile, userid)
# not this notice. # (2) Reproduced in the COPYING file, and at: # http://kamaelia.sourceforge.net/COPYING # Under section 3.5 of the MPL, we are using this text since we deem the MPL # notice inappropriate for this file. As per MPL/GPL/LGPL removal of this # notice is prohibited. # # Please contact us via: [email protected] # to discuss alternative licensing. # ------------------------------------------------------------------------- # """ A commandline tool that creates the Logical key hierachy DB """ from Kamaelia.Community.AM.Kamaelia.KPIFramework.KPI.DB import LKH import sys if __name__ == '__main__': if len(sys.argv) < 4: print "usage:", sys.argv[0], "dbfile keylength numusers" sys.exit(1) dbfile = sys.argv[1] keylen = long(sys.argv[2]) numusers = long(sys.argv[3]) if numusers < 1 : print "numusers", sys.argv[3], "is invalid\n" sys.exit(1) LKH.createDB(dbfile, keylen, numusers)
# Under section 3.5 of the MPL, we are using this text since we deem the MPL # notice inappropriate for this file. As per MPL/GPL/LGPL removal of this # notice is prohibited. # # Please contact us via: [email protected] # to discuss alternative licensing. # ------------------------------------------------------------------------- # """ A commandline tool that describes the metadata of the tree database """ from Kamaelia.Community.AM.Kamaelia.KPIFramework.KPI.DB import LKH import sys if __name__ == '__main__': if len(sys.argv) < 2: print "usage:", sys.argv[0], "dbfile" sys.exit(1) dbfile = sys.argv[1] info = LKH.getInfo(dbfile) print "--DB Information--" print "Key length", info.key_len print "User id range [", info.min_user_id, "-", str(info.max_user_id -1) ,"]" if info.current_user_id == 0: print "Currently there are no users created" else: print "Current userid", info.current_user_id
# http://kamaelia.sourceforge.net/COPYING # Under section 3.5 of the MPL, we are using this text since we deem the MPL # notice inappropriate for this file. As per MPL/GPL/LGPL removal of this # notice is prohibited. # # Please contact us via: [email protected] # to discuss alternative licensing. # ------------------------------------------------------------------------- # """ A commandline tool that describes the metadata of the tree database """ from Kamaelia.Community.AM.Kamaelia.KPIFramework.KPI.DB import LKH import sys if __name__ == "__main__": if len(sys.argv) < 2: print "usage:", sys.argv[0], "dbfile" sys.exit(1) dbfile = sys.argv[1] info = LKH.getInfo(dbfile) print "--DB Information--" print "Key length", info.key_len print "User id range [", info.min_user_id, "-", str(info.max_user_id - 1), "]" if info.current_user_id == 0: print "Currently there are no users created" else: print "Current userid", info.current_user_id
# http://kamaelia.sourceforge.net/AUTHORS - please extend this file, # not this notice. # (2) Reproduced in the COPYING file, and at: # http://kamaelia.sourceforge.net/COPYING # Under section 3.5 of the MPL, we are using this text since we deem the MPL # notice inappropriate for this file. As per MPL/GPL/LGPL removal of this # notice is prohibited. # # Please contact us via: [email protected] # to discuss alternative licensing. # ------------------------------------------------------------------------- # """ A commandline tool that creates the Logical key hierachy DB """ from Kamaelia.Community.AM.Kamaelia.KPIFramework.KPI.DB import LKH import sys if __name__ == '__main__': if len(sys.argv) < 4: print "usage:", sys.argv[0], "dbfile keylength numusers" sys.exit(1) dbfile = sys.argv[1] keylen = long(sys.argv[2]) numusers = long(sys.argv[3]) if numusers < 1: print "numusers", sys.argv[3], "is invalid\n" sys.exit(1) LKH.createDB(dbfile, keylen, numusers)
# ------------------------------------------------------------------------- # """ A commandline tool that prints list of common keys given a list of user ids """ from Kamaelia.Community.AM.Kamaelia.KPIFramework.KPI.DB import LKH import sys if __name__ == '__main__': if len(sys.argv) < 3: print "usage:", sys.argv[0], "dbfile [id1] [id2].." sys.exit(1) dbfile = sys.argv[1] info = LKH.getInfo(dbfile) #validate all the user ids ids = [] for index in range(2, len(sys.argv)): userid = long(sys.argv[index]) if((userid < info.min_user_id) or (userid > info.max_user_id - 1)): print "userid", sys.argv[index], "is invalid" sys.exit(1) ids.append(userid) idkeymap = LKH.getCommonKeys(dbfile, ids) for ID in idkeymap: print "ID=",ID, ",KEY=", idkeymap[ID]
# # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://kamaelia.sourceforge.net/AUTHORS - please extend this file, # not this notice. # (2) Reproduced in the COPYING file, and at: # http://kamaelia.sourceforge.net/COPYING # Under section 3.5 of the MPL, we are using this text since we deem the MPL # notice inappropriate for this file. As per MPL/GPL/LGPL removal of this # notice is prohibited. # # Please contact us via: [email protected] # to discuss alternative licensing. # ------------------------------------------------------------------------- # """ A commandline tool that creates users and creates user configuration files. This configuration file is used by KPIClient """ from Kamaelia.Community.AM.Kamaelia.KPIFramework.KPI.DB import LKH import sys if __name__ == '__main__': if len(sys.argv) < 3: print "usage:", sys.argv[0], "dbfile usercfg1 [usercfg2].. " sys.exit(1) dbfile = sys.argv[1] for index in range(2, len(sys.argv)): LKH.createUser(dbfile, sys.argv[index])
# Please contact us via: [email protected] # to discuss alternative licensing. # ------------------------------------------------------------------------- # """ A commandline tool that prints list of common keys given a list of user ids """ from Kamaelia.Community.AM.Kamaelia.KPIFramework.KPI.DB import LKH import sys if __name__ == '__main__': if len(sys.argv) < 3: print "usage:", sys.argv[0], "dbfile [id1] [id2].." sys.exit(1) dbfile = sys.argv[1] info = LKH.getInfo(dbfile) #validate all the user ids ids = [] for index in range(2, len(sys.argv)): userid = long(sys.argv[index]) if ((userid < info.min_user_id) or (userid > info.max_user_id - 1)): print "userid", sys.argv[index], "is invalid" sys.exit(1) ids.append(userid) idkeymap = LKH.getCommonKeys(dbfile, ids) for ID in idkeymap: print "ID=", ID, ",KEY=", idkeymap[ID]