예제 #1
0
# 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])
예제 #2
0
#     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)
예제 #3
0
#     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)
예제 #4
0
# 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
    
예제 #5
0
#     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
예제 #6
0
#     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)
예제 #7
0
# -------------------------------------------------------------------------
#

"""
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]
예제 #8
0
#
# (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])
예제 #9
0
# 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]