Skip to content

Commit d9d4f8f

Browse files
committed
Beta 0.0.2b0
1 parent 832aa36 commit d9d4f8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1924
-39
lines changed

build/lib/eggdriver/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from eggdriver.driver import init
2+
from eggdriver.library import *
3+
from eggdriver.news import *
4+
from eggdriver.resources import *
5+
from eggdriver.app import *
6+
from eggdriver.pypi import *
7+
from eggdriver.version import *

build/lib/eggdriver/__main__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from eggdriver.app import eggConsole
2+
import sys
3+
4+
for command in sys.argv[1:]:
5+
if command == "console":
6+
eggConsole()
7+
else:
8+
try:
9+
eggConsole(str(command))
10+
except:
11+
print("Error: Please write the command accurately")

build/lib/eggdriver/app.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
from eggdriver.resources.console import get, clearConsole, pg
2+
from eggdriver.resources.constants import white, blue, green
3+
from eggdriver.resources.modules import installFromRequests, upgrade, Repo
4+
from eggdriver.resources.help import welcome
5+
from eggdriver.resources.auth import login, register
6+
7+
"""
8+
FUNCTION eggConsole(command = None)
9+
10+
Display the Eggdriver Console
11+
Currently, the Eggdriver Console commands are:
12+
13+
$nqs Start the NQS Depeloper console
14+
$new Start the News Journalist console
15+
$login Log in Egg-cosystem *comming soon*
16+
$register Register in Egg-cosystem *comming soon*
17+
$install Install a pip package
18+
$upgrade Upgrade a pip package
19+
$pull Import a package stored on a GitHUb repository *comming soon: currently, just use github_com package*
20+
$help Get started command
21+
$clear Clear the Egg Console
22+
$end End the Eggdriver Console
23+
24+
WARNING:
25+
Always use $end command in every console you run
26+
"""
27+
def eggConsole(command = None):
28+
"""Display the Eggdriver Console"""
29+
print(white + "Eggdriver Console is now running")
30+
condition = True
31+
logged = False
32+
while condition:
33+
if command == None:
34+
i = get("egg")
35+
else:
36+
i = "$" + str(command)
37+
print(blue + "$egg> " + green + i + white + "executed")
38+
condition = False
39+
if i == "$nqs":
40+
from nqs import developerConsole
41+
developerConsole()
42+
elif i == "$new":
43+
from eggdriver.news import journalistConsole
44+
journalistConsole()
45+
elif i == "$login":
46+
logged = login()
47+
elif i == "$register":
48+
register()
49+
elif i == "$install":
50+
name = pg("Package:")
51+
installFromRequests([name], False)
52+
elif i == "$upgrade":
53+
name = pg("Package:")
54+
upgrade(name)
55+
elif i == "$pull":
56+
org = pg("User or Organization:")
57+
name = pg("Repository:")
58+
repo = Repo(org, name)
59+
repo.pull()
60+
elif i == "$help":
61+
welcome()
62+
elif i == "$clear":
63+
clearConsole()
64+
elif i == "$end":
65+
print(white + "Eggdriver Console stopped running")
66+
return None
67+
else:
68+
pass

build/lib/eggdriver/driver.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from eggdriver.resources.modules import installFromRequests, install_option_1
2+
from eggdriver.resources.console import sleep
3+
from eggdriver.resources.server import Server
4+
5+
"""
6+
FUNCTION init()
7+
8+
Initialize Repository:
9+
- Upgrade pip
10+
- Install all the packages in requests file
11+
12+
Eg:
13+
init()
14+
>>> Requirement already satisfied: pip in <root> (21.2.4)
15+
"""
16+
def init():
17+
"""Upgrade pip and install all the packages in requests file"""
18+
install_option_1("$upgrade") # Upgrade pip
19+
sleep(10) # Waits 10 ms
20+
installFromRequests() # Install all the packages in requests file
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
from eggdriver.library.repos import *
2+
3+
author="eanorambuena"
4+
_author_email="[email protected]"
5+
6+
eggConsoleCommands=[
7+
"nqs",
8+
"new",
9+
"login,"
10+
"register",
11+
"install",
12+
"upgrade",
13+
"pull",
14+
"help",
15+
"clear",
16+
"end"
17+
]
18+
19+
developerConsoleCommands=[
20+
"display",
21+
"compile",
22+
"save",
23+
"run",
24+
"end",
25+
"delay"
26+
]
27+
28+
nqsCommands=[
29+
"host",
30+
"shots",
31+
"hist",
32+
"draw",
33+
"inject",
34+
"function",
35+
"clear",
36+
"delay"
37+
]
38+
39+
journalistConsoleCommands=[
40+
"save",
41+
"end",
42+
]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
_author = "eanorambuena"
2+
_author_email = "[email protected]"
3+
4+
eggConsoleCommands = [
5+
"nqs",
6+
"new",
7+
"login,"
8+
"register",
9+
"install",
10+
"upgrade",
11+
"pull",
12+
"help",
13+
"clear",
14+
"end"
15+
]
16+
17+
developerConsoleCommands = [
18+
"display",
19+
"compile",
20+
"save",
21+
"run",
22+
"delay",
23+
"end"
24+
]
25+
26+
nqsCommands = [
27+
"host",
28+
"shots",
29+
"hist",
30+
"draw",
31+
"inject",
32+
"function",
33+
"clear",
34+
"delay"
35+
]
36+
37+
journalistConsoleCommands = [
38+
"save",
39+
"end"
40+
]
41+

build/lib/eggdriver/library/repos.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from eggdriver.resources.modules import Repo
2+
3+
# NQS=Repo("PythonForChange", "eggdriver")
4+
# nqs=NQS.pull("nqs")

build/lib/eggdriver/news/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from eggdriver.news.app import *
2+
from eggdriver.news.config import *
3+
from eggdriver.news.news import *

build/lib/eggdriver/news/app.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#Imports
2+
from eggdriver.news.news import New
3+
from eggdriver.news.config import files, year
4+
from eggdriver.resources.console import get
5+
from eggdriver.resources.constants import *
6+
7+
def journalistConsole(condition: bool = True):
8+
print(white + "Journalist Console is now running")
9+
while condition:
10+
print(white + "Title:")
11+
title=get("new")
12+
print(white + "Day:")
13+
day=int(get("new"))
14+
print(white + "Month:")
15+
month=int(get("new"))
16+
new=New(title, day, month, year, files)
17+
print(white + "Tags:")
18+
tagsbycommas = get("new")
19+
new.tags = tagsbycommas.split(", ")
20+
print(white + "Content:")
21+
content = ""
22+
while True:
23+
i = get("new")
24+
if i == "$save":
25+
new.text = content
26+
new.add()
27+
break
28+
elif i[0] == "$":
29+
print(white + "Error: NQS could not found the command \"" + i + " \"")
30+
else:
31+
content += i + "\n"
32+
print(white + "Write $end to close the console")
33+
print(white + "Press enter key to write other new")
34+
command = get("new")
35+
if command == "$end":
36+
print(white + "Journalist Console stopped running")
37+
return "done"
38+

build/lib/eggdriver/news/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from datetime import date
2+
todaysDate = date.today()
3+
4+
# News Config
5+
files = ["README.md"]
6+
year = int(todaysDate.year)

0 commit comments

Comments
 (0)