def listToFile(self, list_ = [], name_ = ''): fileName = '' if name_ != '' : fileName = Path.tempStruct(name_) with open(fileName, 'wb') as f : f.writelines(list_) return fileName
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)