Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
ec861aa5ae | |||
646e1efea2 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.env
|
||||||
|
*.cpython-311.pyc
|
28
README.md
28
README.md
@ -1,2 +1,26 @@
|
|||||||
# TRANSCENDENCE
|
# CLI
|
||||||
The last project of the 42 common core
|
|
||||||
|
## 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
12
command.py
Normal 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
1
database.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from
|
9
login.py
Normal file
9
login.py
Normal 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
8
main.py
Normal 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
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
tinydb==4.8.0
|
Loading…
Reference in New Issue
Block a user