Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Helper/git-steps-multiple-origin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ git remote add all REMOTE-URL-1
git remote set-url --add --push all REMOTE-URL-1
git remote set-url --add --push all REMOTE-URL-2
git push all BRANCH
git fetch --all
git fetch --all

build setup : python setup.py sdist bdist_wheel

upload : twine upload dist/*
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ app.sow(server=True)

<br>

<img src="https://gcdn.pbrd.co/images/5lFK1NdhoCtH.png?o=1" alt="banner">

https://pypi.org/project/createapp/


5 changes: 5 additions & 0 deletions Test/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from createflask import createapp

app = createapp.Create('app')

app.sow(server=False)
69 changes: 51 additions & 18 deletions build/lib/createflask/createapp.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,81 @@
import time
import subprocess
from tqdm import tqdm
import time
from rich.console import*
from rich.theme import*
from rich.progress import track
from rich.markdown import Markdown

custome_theme = Theme({'success': 'green', 'error': 'bold red', 'normal': 'yellow'})

console = Console(theme=custome_theme)

class Create:
def __init__(self, name):
self.name = name

start = time.time()

tasks1 = ['mkdir static', 'mkdir templates', 'cd templates', 'echo from flask import Flask > app.py', 'echo app=Flask(__name__) >> app.py', 'echo @app.route("/") >> app.py', 'echo def index(): >> app.py', 'echo return "Hello world this is flask app" >> app.py', 'echo if __name__=="__main__": >> app.py', 'echo app.run(debug=True) >> app.py', 'echo click==8.0.1 >> requirements.txt', 'echo Flask==2.0.1 >> requirements.txt', 'echo importlib-metadata==4.8.1 >> requirements.txt', 'echo itsdangerous==2.0.1 >> requirements.txt', 'echo Jinja2==3.0.1 >> requirements.txt', 'echo MarkupSafe==2.0.1 >> requirements.txt', 'echo typing-extensions==3.10.0.2 >> requirements.txt', 'echo Werkzeug==2.0.1 >> requirements.txt', 'echo zipp==3.5.0 >> requirements.txt', 'echo colorama==0.4.4 >> requirements.txt']

tasks1 = ['mkdir static', 'mkdir templates', 'cd templates', 'echo from flask import Flask > app.py', 'echo app=Flask(__name__) >> app.py', 'echo @app.route("/") >> app.py', 'echo def index(): >> app.py', 'echo return "Hello world this is flask app" >> app.py', 'echo if __name__=="__main__": >> app.py', 'echo app.run(debug=True) >> app.py', 'echo click==8.0.1 >> requirements.txt', 'echo Flask==2.0.1 >> requirements.txt', 'echo importlib-metadata==4.8.1 >> requirements.txt', 'echo itsdangerous==2.0.1 >> requirements.txt', 'echo Jinja2==3.0.1 >> requirements.txt', 'echo MarkupSafe==2.0.1 >> requirements.txt', 'echo typing-extensions==3.10.0.2 >> requirements.txt', 'echo Werkzeug==2.0.1 >> requirements.txt', 'echo zipp==3.5.0 >> requirements.txt', 'echo colorama==0.4.4 >> requirements.txt']

def sow(self,server):
execution = "run"

print('build starting...')
console_ = Console()

now = datetime.now()

current_time = now.strftime("%H:%M:%S")

MARKDOWN = f'''

# Flask app build starting at {current_time}

for task in self.tasks1:
p1 = subprocess.run(task, shell=True)
'''

md = Markdown(MARKDOWN)

console_.print(md)

try:
for task in self.tasks1:
p1 = subprocess.run(task, shell=True)

if p1.returncode != 0:
execution = "dismiss"
break
if p1.returncode != 0:
execution = "dismiss"
break

show_ = ['app.py', 'requirements.txt', 'static dir', 'template dir']

with console_.status("[bold green]Working on tasks...") as status:
while show_:
task_ = show_.pop(0)
time.sleep(1)
console_.log(f"Building {task_} complete")


except:
console.print('Build Failed :bangbang:', style='error')

if execution == "run":
for i in tqdm (range (len(self.tasks1)),
desc="Creating…",
ascii=False, ncols=75):
time.sleep(0.02)

finish = time.time()

final_task = ['pip install --upgrade flask','start http://127.0.0.1:5000/', 'python app.py']

print(f'flask app created in {round(finish-self.start, 2)} seconds')

console.print('Build success :heavy_check_mark:', style='success')
console.print(f'flask app created in {round(finish-self.start, 2)} seconds', style='success')
time.sleep(1)

if server==True:
console.print('Installing Dependencies...', style='normal')
for task in final_task:
p2 = subprocess.run(task, shell=True)
p2 = subprocess.run(task, shell=True , stderr=subprocess.DEVNULL)
if final_task.index(task) == 1:
console.print('Running server on port 5000', style='success')



if __name__ == "__main__":
app = Create('app')

app.sow(server=True)
app.sow(server=False)
Empty file.
50 changes: 50 additions & 0 deletions build/lib/flask-createapp/flask_create.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import time
import subprocess
from tqdm import tqdm
import time

class Create:
def __init__(self, name):
self.name = name

start = time.time()

tasks1 = ['mkdir static', 'mkdir templates', 'cd templates', 'echo from flask import Flask > app.py', 'echo app=Flask(__name__) >> app.py', 'echo @app.route("/") >> app.py', 'echo def index(): >> app.py', 'echo return "Hello world this is flask app" >> app.py', 'echo if __name__=="__main__": >> app.py', 'echo app.run(debug=True) >> app.py', 'echo click==8.0.1 >> requirements.txt', 'echo Flask==2.0.1 >> requirements.txt', 'echo importlib-metadata==4.8.1 >> requirements.txt', 'echo itsdangerous==2.0.1 >> requirements.txt', 'echo Jinja2==3.0.1 >> requirements.txt', 'echo MarkupSafe==2.0.1 >> requirements.txt', 'echo typing-extensions==3.10.0.2 >> requirements.txt', 'echo Werkzeug==2.0.1 >> requirements.txt', 'echo zipp==3.5.0 >> requirements.txt', 'echo colorama==0.4.4 >> requirements.txt']


def sow(self,server):
execution = "run"

print('build starting...')

for task in self.tasks1:
p1 = subprocess.run(task, shell=True)

if p1.returncode != 0:
execution = "dismiss"
break

if execution == "run":
for i in tqdm (range (len(self.tasks1)),
desc="Creating…",
ascii=False, ncols=75):
time.sleep(0.02)

finish = time.time()

final_task = ['start http://127.0.0.1:5000/', 'python app.py']

print(f'flask app created in {round(finish-self.start, 2)} seconds')

if server==True:
for task in final_task:
subprocess.run(task, shell=True)





if __name__ == "__main__":
app = Create('app')

app.sow(server=False)
5 changes: 4 additions & 1 deletion createflask.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: createflask
Version: 0.0.5.1
Version: 1.7.5
Summary: Python package for creating flaskapp
Home-page: UNKNOWN
Author: Throttlerz (Siddhartha Roy)
Expand All @@ -22,6 +22,7 @@ License-File: LICENSE

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/createflask)



## `pip install flask-createapp`

Expand All @@ -45,6 +46,8 @@ app.sow(server=True)

<br>

https://pypi.org/project/createapp/




Expand Down
4 changes: 3 additions & 1 deletion createflask.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ createflask.egg-info/PKG-INFO
createflask.egg-info/SOURCES.txt
createflask.egg-info/dependency_links.txt
createflask.egg-info/requires.txt
createflask.egg-info/top_level.txt
createflask.egg-info/top_level.txt
flask-createapp/__init__.py
flask-createapp/flask_create.py
2 changes: 1 addition & 1 deletion createflask.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tqdm
rich
1 change: 1 addition & 0 deletions createflask.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
createflask
flask-createapp
69 changes: 51 additions & 18 deletions createflask/createapp.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,81 @@
import time
import subprocess
from tqdm import tqdm
import time
from rich.console import*
from rich.theme import*
from rich.progress import track
from rich.markdown import Markdown

custome_theme = Theme({'success': 'green', 'error': 'bold red', 'normal': 'yellow'})

console = Console(theme=custome_theme)

class Create:
def __init__(self, name):
self.name = name

start = time.time()

tasks1 = ['mkdir static', 'mkdir templates', 'cd templates', 'echo from flask import Flask > app.py', 'echo app=Flask(__name__) >> app.py', 'echo @app.route("/") >> app.py', 'echo def index(): >> app.py', 'echo return "Hello world this is flask app" >> app.py', 'echo if __name__=="__main__": >> app.py', 'echo app.run(debug=True) >> app.py', 'echo click==8.0.1 >> requirements.txt', 'echo Flask==2.0.1 >> requirements.txt', 'echo importlib-metadata==4.8.1 >> requirements.txt', 'echo itsdangerous==2.0.1 >> requirements.txt', 'echo Jinja2==3.0.1 >> requirements.txt', 'echo MarkupSafe==2.0.1 >> requirements.txt', 'echo typing-extensions==3.10.0.2 >> requirements.txt', 'echo Werkzeug==2.0.1 >> requirements.txt', 'echo zipp==3.5.0 >> requirements.txt', 'echo colorama==0.4.4 >> requirements.txt']

tasks1 = ['mkdir static', 'mkdir templates', 'cd templates', 'echo from flask import Flask > app.py', 'echo app=Flask(__name__) >> app.py', 'echo @app.route("/") >> app.py', 'echo def index(): >> app.py', 'echo return "Hello world this is flask app" >> app.py', 'echo if __name__=="__main__": >> app.py', 'echo app.run(debug=True) >> app.py', 'echo click==8.0.1 >> requirements.txt', 'echo Flask==2.0.1 >> requirements.txt', 'echo importlib-metadata==4.8.1 >> requirements.txt', 'echo itsdangerous==2.0.1 >> requirements.txt', 'echo Jinja2==3.0.1 >> requirements.txt', 'echo MarkupSafe==2.0.1 >> requirements.txt', 'echo typing-extensions==3.10.0.2 >> requirements.txt', 'echo Werkzeug==2.0.1 >> requirements.txt', 'echo zipp==3.5.0 >> requirements.txt', 'echo colorama==0.4.4 >> requirements.txt']

def sow(self,server):
execution = "run"

print('build starting...')
console_ = Console()

now = datetime.now()

current_time = now.strftime("%H:%M:%S")

MARKDOWN = f'''

# Flask app build starting at {current_time}

for task in self.tasks1:
p1 = subprocess.run(task, shell=True)
'''

md = Markdown(MARKDOWN)

console_.print(md)

try:
for task in self.tasks1:
p1 = subprocess.run(task, shell=True)

if p1.returncode != 0:
execution = "dismiss"
break
if p1.returncode != 0:
execution = "dismiss"
break

show_ = ['app.py', 'requirements.txt', 'static dir', 'template dir']

with console_.status("[bold green]Working on tasks...") as status:
while show_:
task_ = show_.pop(0)
time.sleep(1)
console_.log(f"Building {task_} complete")


except:
console.print('Build Failed :bangbang:', style='error')

if execution == "run":
for i in tqdm (range (len(self.tasks1)),
desc="Creating…",
ascii=False, ncols=75):
time.sleep(0.02)

finish = time.time()

final_task = ['pip install --upgrade flask','start http://127.0.0.1:5000/', 'python app.py']

print(f'flask app created in {round(finish-self.start, 2)} seconds')

console.print('Build success :heavy_check_mark:', style='success')
console.print(f'flask app created in {round(finish-self.start, 2)} seconds', style='success')
time.sleep(1)

if server==True:
console.print('Installing Dependencies...', style='normal')
for task in final_task:
p2 = subprocess.run(task, shell=True)
p2 = subprocess.run(task, shell=True , stderr=subprocess.DEVNULL)
if final_task.index(task) == 1:
console.print('Running server on port 5000', style='success')



if __name__ == "__main__":
app = Create('app')

app.sow(server=True)
app.sow(server=False)
Binary file added dist/createflask-0.1.7.5-py3-none-any.whl
Binary file not shown.
Binary file added dist/createflask-0.1.7.5.tar.gz
Binary file not shown.
Binary file added dist/createflask-1.7.5-py3-none-any.whl
Binary file not shown.
Binary file added dist/createflask-1.7.5.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
long_description = "\n" + fh.read()

VERSION = '0.0.5.1'
VERSION = '1.7.5'

DESCRIPTION = 'Python package for creating flaskapp'
LONG_DESCRIPTION = 'Now create your flask development environment with 2 simple commands'
Expand All @@ -22,7 +22,7 @@
long_description_content_type="text/markdown",
long_description=long_description,
packages=find_packages(),
install_requires=['tqdm'],
install_requires=['rich'],
keywords=['python', 'web development', 'createapp',
'automation', 'flask', 'python flask'],
classifiers=[
Expand Down