1+ # Imports
2+ from eggdriver .resources .console import get , clearConsole
3+ from eggdriver .resources .constants import *
4+ from eggdriver .resources .modules import install , upgrade , Repo
5+ from eggdriver .resources .help import help
6+ from eggdriver .resources .auth import login , register
7+
8+ """
9+ FUNCTION eggConsole(condition: bool = True)
10+
11+ Display the Egg Console
12+ Currently, the Egg Console commands are:
13+
14+ $nqs Start the NQS Depeloper console
15+ $new Start the News Journalist console
16+ $login Log in Egg-cosystem *comming soon*
17+ $register Register in Egg-cosystem *comming soon*
18+ $install Install a pip package
19+ $upgrade Upgrade a pip package
20+ $pull Import a package stored on a GitHUb repository *comming soon: currently, just use github_com package*
21+ $help Get started command
22+ $clear Clear the Egg Console
23+ $end End the Egg Console
24+
25+ WARNING:
26+ Always use $end command in every console you run
27+ *ONLY use a condition different to True as an argument of eggConsole(condition) if you know what are you doing**
28+ This is the reason why condition only allows <<bool>> as data type
29+ """
30+ def eggConsole (condition : bool = True ):
31+ print (white + "Egg Console is now running" )
32+ logged = 0
33+ while condition :
34+ i = get ("egg" )
35+ if i == "$nqs" :
36+ from nqs .developer .app import developerConsole
37+ developerConsole ()
38+ elif i == "$new" :
39+ from news .app import journalistConsole
40+ journalistConsole ()
41+ elif i == "$login" :
42+ login ()
43+ elif i == "$register" :
44+ register ()
45+ elif i == "$install" :
46+ print (white + "Package:" )
47+ name = get ("egg" )
48+ install (name )
49+ elif i == "$upgrade" :
50+ print (white + "Package:" )
51+ name = get ("egg" )
52+ upgrade (name )
53+ elif i == "$pull" :
54+ print (white + "Repo:" )
55+ name = get ("egg" )
56+ repo = Repo (name )
57+ print (white + "Package:" )
58+ package = get ("egg" )
59+ last = repo .pull (package )
60+ # *comming soon*
61+ elif i == "$help" :
62+ help ()
63+ elif i == "$clear" :
64+ clearConsole ()
65+ elif i == "$end" :
66+ print (white + "Egg Console stopped running" )
67+ return "done"
68+ else :
69+ pass
0 commit comments