Skip to content

Commit 7007d44

Browse files
committed
0.0.1a1
1 parent d7bc9e5 commit 7007d44

File tree

115 files changed

+1538
-15
lines changed

Some content is hidden

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

115 files changed

+1538
-15
lines changed

build/lib/eggdriver/__init__.py

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

build/lib/eggdriver/app.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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
File renamed without changes.
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+
]

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("NQS")
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)

build/lib/eggdriver/news/news.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
from eggdriver.resources.console import sleep
2+
3+
class New():
4+
def __init__(self, title: str, day: int, month: int, year: int = 2021, files = ["README.md"]):
5+
self.title = title
6+
if day < 10:
7+
newday = "0" + str(day)
8+
else:
9+
newday = str(day)
10+
if month < 10:
11+
newmonth = "0" + str(month)
12+
else:
13+
newmonth = str(month)
14+
self.date = newmonth + "/" + newday + "/" + str(year)
15+
self.place = "Santiago, Chile"
16+
self.text = ""
17+
self.tags = []
18+
self.files = files
19+
def tag(self, text: str):
20+
try:
21+
self.tags.append(text)
22+
except:
23+
print("A tagging bug was happen")
24+
def format(self):
25+
t = "\n### " + self.title + "\n#### " + self.date + " " + self.place
26+
t += "\n##### Tags: "
27+
try:
28+
for i in self.tags:
29+
t += "[" + i + "](https://github.com/topics/" + i + ")"
30+
except:
31+
pass
32+
t += "\n" + self.text + "\n"
33+
return t
34+
def add(self):
35+
try:
36+
T = self.format()
37+
try:
38+
for i in self.files:
39+
f = open(i,"a")
40+
f.write(T)
41+
print("Writting the new in " + i)
42+
sleep(100)
43+
f.close()
44+
print("New added succesfully")
45+
print("Title: " + self.title)
46+
print("Date: " + self.date)
47+
print("Content: " + preview(self.text.split()))
48+
except:
49+
print("A writting bug was happen")
50+
except:
51+
print("A formatting bug was happen")
52+
53+
def preview(string: str):
54+
preview = ""
55+
try:
56+
preview += string[0]
57+
except:
58+
pass
59+
try:
60+
preview += " " + string[1]
61+
except:
62+
pass
63+
try:
64+
preview += " " + string[2]
65+
except:
66+
pass
67+
try:
68+
preview += " "+ string[3]
69+
except:
70+
pass
71+
preview += "..."
72+
return preview

0 commit comments

Comments
 (0)