reorganize files to move lib, templates, www into 'degal' package, keep separate 'cgi-bin' for now
from lib import shorturl
db = shorturl.DB(read_only=False)
ids = dict()
newid = db.db['_id']
for key in db.db.keys() :
if key.startswith('_') :
continue
if len(key) == 1 :
print "key %s is too short!?" % key
del db.db[key]
continue
print "%s:" % key,
id = shorturl.key2int(key)
if id in ids :
newkey = shorturl.int2key(newid)
newid += 1
print "%d -> %s, -> %s" % (id, ids[id], newkey)
db.db[newkey] = db.db[key]
del db.db[key]
else :
print "ok"
ids[id] = key