Compare commits

..

2 Commits
main ... cli

Author SHA1 Message Date
ec861aa5ae add readme 2023-11-21 16:12:12 +01:00
646e1efea2 init 2023-11-21 16:08:23 +01:00
7 changed files with 58 additions and 3 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.env
*.cpython-311.pyc

View File

@ -1,4 +1,26 @@
# TRANSCENDENCE
The last project of the 42 common core
# CLI
# adrien est une merde
## Installation
- Clone the project:
``` bash
git clone https://git.chauvet.pro/michel/ft_transcendence
cd ft_transcendence
git switch cli
```
- Create python virtual environnement.
``` bash
python3 -m venv .env
```
- Source the environnement.
``` bash
source .env/bin/activate
```
- Install the requirements
``` bash
pip install -r requirements.txt
```
- Start the developpement server
```
python main.py
```

12
command.py Normal file
View File

@ -0,0 +1,12 @@
class AbstractCommand():
def __init__(self, name: str, arg: [str], help_text: str):
self.name = name;
self.arg = arg;
self.help_text = help_text;
def execute(self):
pass
def check_arg(self):
pass

1
database.py Normal file
View File

@ -0,0 +1 @@
from

9
login.py Normal file
View File

@ -0,0 +1,9 @@
from command import AbstractCommand
class Login(AbstractCommand):
def check_arg(self):
return len(self.arg) < 2
def execute(self) -> str:

8
main.py Normal file
View File

@ -0,0 +1,8 @@
import sys
from command import commands
import login
args = sys.argv[1:]
print(commands[0].__name__)

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
tinydb==4.8.0