From cef9cea12cadbb8ea330abefdeaccef9405f2ba8 Mon Sep 17 00:00:00 2001 From: study-faraphel Date: Mon, 6 Jan 2025 23:55:34 +0100 Subject: [PATCH] added an argument to specify the network interface to use for communication --- README.md | 6 +++++- source/__main__.py | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0c175d0..ea7c078 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,14 @@ d'inséré une machine inconnu pour pertuber le réseau. ## Usage +Cet application nécessite que votre machine utilise `Python >= 3.13` avec `chrony` +pour synchroniser les machines entre elles. + Debian ```bash # dependencies -sudo apt install ffmpeg +sudo apt upgrade +sudo apt install -y git ffmpeg libportaudio2 # download the project git clone https://git.faraphel.fr/study-faraphel/M2-PT-DRP diff --git a/source/__main__.py b/source/__main__.py index 1d60555..9bfbc3a 100644 --- a/source/__main__.py +++ b/source/__main__.py @@ -1,5 +1,21 @@ +import argparse + from source.managers import Manager -manager = Manager("wlp1s0") +parser = argparse.ArgumentParser( + prog="ISRI-DRP", + description="Create a network of machine that try to play an audio file synchronously." +) + +parser.add_argument( + "-i", "--interface", + required=True, + help="The interface on which other peers are accessible." +) + +arguments = parser.parse_args() + + +manager = Manager(arguments.interface) manager.loop()