Initial commit.
This commit is contained in:
+108
@@ -0,0 +1,108 @@
|
||||
# AGPL 3 or any later version
|
||||
# (C) J.Y.Amihud ( Blender Dumbass )
|
||||
|
||||
# Basic sys to get through to different modules
|
||||
from modules import troubleshooter
|
||||
troubleshooter.run()
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
from modules.Common import *
|
||||
|
||||
if len(sys.argv) < 2 or "--help" in sys.argv:
|
||||
from modules import Help
|
||||
Help.Help()
|
||||
|
||||
elif "--set" in sys.argv:
|
||||
from modules import Set
|
||||
Set.Set()
|
||||
|
||||
elif "--federation" in sys.argv:
|
||||
from modules import Federation
|
||||
Federation.Federation()
|
||||
|
||||
elif "--account" in sys.argv:
|
||||
from modules import Account
|
||||
Account.Account()
|
||||
|
||||
elif "--analyse" in sys.argv:
|
||||
from modules import Analyse
|
||||
Analyse.Analyse()
|
||||
|
||||
elif "--config" in sys.argv:
|
||||
from modules import Set
|
||||
data = Set.Load() # Making sure
|
||||
Set.Save(data) # that config.json exists
|
||||
os.system(Set.Load().get("editor", "nano")+" "+Set.Folder()+"/config.json")
|
||||
|
||||
elif "--run" in sys.argv:
|
||||
from modules import Run
|
||||
|
||||
elif "--folder" in sys.argv:
|
||||
from modules import Set
|
||||
print(Set.Folder())
|
||||
|
||||
elif "--transfer" in sys.argv:
|
||||
try:
|
||||
folder = sys.argv[ sys.argv.index("--transfer") + 1]
|
||||
if "--" in folder: 1/0 # Failing this for the error message.
|
||||
from modules import Legacy
|
||||
Legacy.Transfer(folder)
|
||||
except Exception as e:
|
||||
print(clr["bold"]+clr["tdrd"]+"Error:"+clr["norm"]+" Folder Wasn't Specified!", e)
|
||||
print('Use: $ python3 run.py --transfer ~/Software/blenderdumbass_site/')
|
||||
|
||||
elif "--create" in sys.argv:
|
||||
try:
|
||||
name = sys.argv[ sys.argv.index("--create") + 1]
|
||||
if "--" in name: 1/0 # Failing this for the error message.
|
||||
from modules import Create
|
||||
Create.Create(name)
|
||||
except Exception as e:
|
||||
print(clr["bold"]+clr["tdrd"]+"Error:"+clr["norm"]+" Name Wasn't Specified!", e)
|
||||
print('Use: $ python3 run.py --create article/My_Article')
|
||||
|
||||
elif "--write" in sys.argv:
|
||||
try:
|
||||
name = sys.argv[ sys.argv.index("--write") + 1]
|
||||
if "--" in name: 1/0 # Failing this for the error message.
|
||||
from modules import Create
|
||||
Create.Write(name)
|
||||
except Exception as e:
|
||||
print(clr["bold"]+clr["tdrd"]+"Error:"+clr["norm"]+" Name Wasn't Specified!", e)
|
||||
print('Use: $ python3 run.py --write article/My_Article')
|
||||
|
||||
elif "--metadata" in sys.argv:
|
||||
try:
|
||||
name = sys.argv[ sys.argv.index("--metadata") + 1]
|
||||
if "--" in name: 1/0 # Failing this for the error message.
|
||||
from modules import Create
|
||||
Create.Metadata(name)
|
||||
except Exception as e:
|
||||
print(clr["bold"]+clr["tdrd"]+"Error:"+clr["norm"]+" Name Wasn't Specified!", e)
|
||||
print('Use: $ python3 run.py --metadata article/My_Article')
|
||||
|
||||
elif "--publish" in sys.argv:
|
||||
try:
|
||||
name = sys.argv[ sys.argv.index("--publish") + 1]
|
||||
if "--" in name: 1/0 # Failing this for the error message.
|
||||
from modules import Create
|
||||
Create.Publish(name)
|
||||
except Exception as e:
|
||||
print(clr["bold"]+clr["tdrd"]+"Error:"+clr["norm"]+" Name Wasn't Specified!", e)
|
||||
print('Use: $ python3 run.py --publish article/My_Article')
|
||||
|
||||
elif "--ban" in sys.argv:
|
||||
try:
|
||||
name = sys.argv[ sys.argv.index("--ban") + 1]
|
||||
if "--" in name: 1/0 # Failing this for the error message.
|
||||
from modules import Set
|
||||
Set.AddBannedCookie(name)
|
||||
except Exception as e:
|
||||
print(clr["bold"]+clr["tdrd"]+"Error:"+clr["norm"]+" Cookie to ban wasn't specified!", e)
|
||||
print('Use: $ python3 run.py --ban QZ9434GP7QV7DZ')
|
||||
|
||||
else:
|
||||
print(clr["bold"]+clr["tdrd"]+"Unknown command!"+clr["norm"])
|
||||
|
||||
Reference in New Issue
Block a user