Skip to content

Commit

Permalink
[ref] Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
islam kamel committed Jul 9, 2022
1 parent 2f87112 commit fee4073
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 4 additions & 0 deletions django-start.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from src.django_start.main import run

if __name__ == '__main__':
run()
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "Django-start-islam.kamel"
name = "django_start"
version = "0.1.0"
authors = [
{ name="Islam Kamel", email="[email protected]" },
Expand Down
2 changes: 1 addition & 1 deletion src/django_start/django_start.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from virtualenv.virtualenv import VirtualEnv
from .virtualenv.virtualenv import VirtualEnv


class DjangoStart:
Expand Down
10 changes: 3 additions & 7 deletions src/django_start/main.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import os
import sys
from django_start import DjangoStart
from update_files import UpdateFile
from .django_start import DjangoStart
from .update_files import UpdateFile
import time


def start():
return os.getcwd(), sys.argv


if __name__ == "__main__":
def run():
workdir, arguments = start()
data = {}
try:
Expand All @@ -18,16 +18,12 @@ def start():
except IndexError:
print('Enter valid command < core_name app_name >')
sys.exit(1)

app = DjangoStart(
workdir=workdir,
**data
)
filemanager = UpdateFile(workdir=workdir, **data)

print('Create Environment ✨')
time.sleep(0.3)
app.create_env()
print('Install Django ⬇')
time.sleep(0.3)
app.install_dep()
Expand Down

0 comments on commit fee4073

Please sign in to comment.