mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-29 22:20:34 -08:00
doc and style: formatted the whole codebase to pep8 plus added documentation where necessary
This commit is contained in:
@@ -1,23 +1,26 @@
|
||||
from datetime import datetime
|
||||
# import tempfile
|
||||
import shutil
|
||||
# import os
|
||||
|
||||
# TODO: make it use color_text instead of fixed vals
|
||||
# from .kivy_markup_helper import color_text
|
||||
|
||||
|
||||
# utility functions
|
||||
def write_crash(e:Exception):
|
||||
def write_crash(e: Exception):
|
||||
index = datetime.today()
|
||||
error = f"[b][color=#fa0000][ {index} ]:[/color][/b]\n(\n\n{e}\n\n)\n"
|
||||
try:
|
||||
with open("crashdump.txt","a") as file:
|
||||
with open("crashdump.txt", "a") as file:
|
||||
file.write(error)
|
||||
except:
|
||||
with open("crashdump.txt","w") as file:
|
||||
with open("crashdump.txt", "w") as file:
|
||||
file.write(error)
|
||||
return index
|
||||
|
||||
def move_file(source_path,dest_path):
|
||||
|
||||
def move_file(source_path, dest_path):
|
||||
try:
|
||||
path = shutil.move(source_path,dest_path)
|
||||
return (1,path)
|
||||
path = shutil.move(source_path, dest_path)
|
||||
return (1, path)
|
||||
except Exception as e:
|
||||
return (0,e)
|
||||
return (0, e)
|
||||
|
||||
Reference in New Issue
Block a user