@获取备份文件列表
(self,get)
| 142 | return public.returnMsg(True, 'DEL_SUCCESS'); |
| 143 | |
| 144 | def get_backup_list(self,get): |
| 145 | """ |
| 146 | @获取备份文件列表 |
| 147 | """ |
| 148 | nlist = [] |
| 149 | search = '' |
| 150 | path = get.path |
| 151 | |
| 152 | if hasattr(get,'search'): |
| 153 | search = get['search'].strip().lower() |
| 154 | |
| 155 | path = session['config']['backup_path'] + '/database/sqlite/' + public.md5(path) |
| 156 | if not os.path.exists(path): os.makedirs(path) |
| 157 | for name in os.listdir(path): |
| 158 | if search: |
| 159 | if name.lower().find(search) == -1: continue; |
| 160 | |
| 161 | arrs = name.split('_') |
| 162 | |
| 163 | filepath = '{}/{}'.format(path,name).replace('//','/') |
| 164 | stat = os.stat(filepath) |
| 165 | |
| 166 | item = {} |
| 167 | item['name'] = name |
| 168 | item['filepath'] = filepath |
| 169 | item['size'] = stat.st_size |
| 170 | item['mtime'] = int(stat.st_mtime) |
| 171 | |
| 172 | nlist.append(item) |
| 173 | return nlist |
| 174 | |
| 175 | def get_table_list(self,args): |
| 176 | """ |