def createStructure(): for nameDir in [Path.TempAvatar, \ Path.tempStruct('structure'), \ Path.tempStruct('client'), \ Path.tempStruct('server'), \ Path.config('treeBackup'), \ Path.Avatar, \ Path.Certificates] : if not os.path.isdir(nameDir): os.makedirs(nameDir) cwd = os.getcwd() while os.path.basename(cwd) not in (os.sep, '', 'LightMight') : head, tail = os.path.split(cwd) cwd = head if os.path.basename(cwd) == 'LightMight' : moveFile(os.path.join(cwd, 'contents', 'icons', 'error.png'), \ os.path.join(Path.TempAvatar, 'error'), \ False)
def createCertificate(): rsaKey = MC.RSA.gen_key(2048, 65537) rsaKey.save_key(Path.config('prvKey.pem'), cipher = None, callback = cB ) rsaKey.save_pub_key(Path.config('pubKey.pem'))