summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLyes Saadi <mail@lyes.eu>2020-09-02 17:14:52 +0100
committerLyes Saadi <mail@lyes.eu>2020-09-02 17:14:52 +0100
commitc1e9ae65824febedb527381e457a4318a5f0f97e (patch)
treee4021776cc783c8248e2e7dd6cc0d082d0bbfe5b
parent4930ca0b4b592eb0894e82ac6f42ff71cbed714c (diff)
downloadspec-c1e9ae65824febedb527381e457a4318a5f0f97e.tar.gz
spec-c1e9ae65824febedb527381e457a4318a5f0f97e.tar.xz
spec-c1e9ae65824febedb527381e457a4318a5f0f97e.zip
Restructuring the mycroft directory
-rwxr-xr-xmycroft/mycroft/mycroft (renamed from mycroft/mycroft)39
-rw-r--r--mycroft/mycroft/mycroft.conf (renamed from mycroft/mycroft.conf)0
-rw-r--r--mycroft/mycroft/mycroft.spec (renamed from mycroft/mycroft.spec)0
-rw-r--r--mycroft/python-adapt-parser/python-adapt-parser.spec (renamed from mycroft/python-adapt-parser.spec)0
-rw-r--r--mycroft/python-fann2/python-fann2.spec (renamed from mycroft/python-fann2.spec)0
-rw-r--r--mycroft/python-lazy/python-lazy.spec (renamed from mycroft/python-lazy.spec)0
-rw-r--r--mycroft/python-lingua-franca/python-lingua-franca.spec (renamed from mycroft/python-lingua-franca.spec)0
-rw-r--r--mycroft/python-msk/python-msk.spec (renamed from mycroft/python-msk.spec)0
-rw-r--r--mycroft/python-msm/msm-no-sudo-pip.patch (renamed from mycroft/msm-no-sudo-pip.patch)0
-rw-r--r--mycroft/python-msm/python-msm.spec (renamed from mycroft/python-msm.spec)0
-rw-r--r--mycroft/python-padaos/python-padaos.spec (renamed from mycroft/python-padaos.spec)0
-rw-r--r--mycroft/python-padatious/python-padatious.spec (renamed from mycroft/python-padatious.spec)0
-rw-r--r--mycroft/python-pako/python-pako.spec (renamed from mycroft/python-pako.spec)0
-rw-r--r--mycroft/python-petact/python-petact.spec (renamed from mycroft/python-petact.spec)0
-rw-r--r--mycroft/python-pocketsphinx/python-pocketsphinx.spec (renamed from mycroft/python-pocketsphinx.spec)0
-rw-r--r--mycroft/python-precise-runner/python-precise-runner.spec (renamed from mycroft/python-precise-runner.spec)0
-rwxr-xr-xmycroft/python-speech_recognition/generate-SpeechRecognition-tarball.sh (renamed from mycroft/generate-SpeechRecognition-tarball.sh)0
-rw-r--r--mycroft/python-speech_recognition/python-speech_recognition.spec (renamed from mycroft/python-speech_recognition.spec)0
-rw-r--r--mycroft/python-speech_recognition/speech_recognition-3.8.1-no-bundling.tar.gz (renamed from mycroft/speech_recognition-3.8.1-no-bundling.tar.gz)bin33789090 -> 33789090 bytes
-rwxr-xr-xmycroft/python-xxhash/generate-xxhash-tarball.sh (renamed from mycroft/generate-xxhash-tarball.sh)0
-rw-r--r--mycroft/python-xxhash/python-xxhash-1.4.3-no-bundling.tar.gz (renamed from mycroft/python-xxhash-1.4.3-no-bundling.tar.gz)bin12854 -> 12854 bytes
-rw-r--r--mycroft/python-xxhash/python-xxhash.spec (renamed from mycroft/python-xxhash.spec)0
22 files changed, 39 insertions, 0 deletions
diff --git a/mycroft/mycroft b/mycroft/mycroft/mycroft
index c3dae55..34e35dc 100755
--- a/mycroft/mycroft
+++ b/mycroft/mycroft/mycroft
@@ -23,6 +23,12 @@ services = {
}
def help(_type="top", code=0):
+ """
+ Function to display help messages and exit the program.
+
+ @param _type The type of the help message.
+ @param code The return code to exit with.
+ """
helps = {
"top":
"""Welcome to the Mycroft command line utility!
@@ -68,6 +74,30 @@ Optional arguments:
sys.exit(code)
def parse_flags(args):
+ """
+ Simplistic function to parse the arguments given to the executable, remove
+ all options ("-" and "--") comparing them to a "flags" list and determining
+ which are activated in order to change the behaviour of the program.
+
+ This function will also remove all the flags from the args list.
+
+ Every option on the form -o=var or --option=var will have var used as a
+ value to the flag and stored as a value to the flag which will be stored as
+ the key. A flag without value will have None instead. So a typical example
+ will be:
+
+ {
+ "name_of_activated_flag": None,
+ "flag_with_value": "var",
+ }
+
+ If an option is not in the "flags" list, the program will exit with a
+ message and the code 2.
+
+ @param args The arguments of the executable.
+ @return activated All the trigered flags and their values.
+ @return args The arguments with all options removed.
+ """
activated = {}
args_orig = args.copy()
for arg in args_orig:
@@ -110,7 +140,13 @@ if len(args) == 0:
########## START ##########
def start(args):
+ """
+ The start subcommand.
+ """
def launch(name, restart=False, foreground=False):
+ """
+ Function to launch a service.
+ """
if restart:
stop(["", name])
if foreground:
@@ -149,6 +185,9 @@ def start(args):
########## STOP ##########
def stop(args):
+ """
+ The stop subcommand.
+ """
if "all" in args:
args = [""] + list(services.keys())
for serv in args[1:]:
diff --git a/mycroft/mycroft.conf b/mycroft/mycroft/mycroft.conf
index 222faa1..222faa1 100644
--- a/mycroft/mycroft.conf
+++ b/mycroft/mycroft/mycroft.conf
diff --git a/mycroft/mycroft.spec b/mycroft/mycroft/mycroft.spec
index a988593..a988593 100644
--- a/mycroft/mycroft.spec
+++ b/mycroft/mycroft/mycroft.spec
diff --git a/mycroft/python-adapt-parser.spec b/mycroft/python-adapt-parser/python-adapt-parser.spec
index 5e05a63..5e05a63 100644
--- a/mycroft/python-adapt-parser.spec
+++ b/mycroft/python-adapt-parser/python-adapt-parser.spec
diff --git a/mycroft/python-fann2.spec b/mycroft/python-fann2/python-fann2.spec
index de3ec7b..de3ec7b 100644
--- a/mycroft/python-fann2.spec
+++ b/mycroft/python-fann2/python-fann2.spec
diff --git a/mycroft/python-lazy.spec b/mycroft/python-lazy/python-lazy.spec
index b61eec2..b61eec2 100644
--- a/mycroft/python-lazy.spec
+++ b/mycroft/python-lazy/python-lazy.spec
diff --git a/mycroft/python-lingua-franca.spec b/mycroft/python-lingua-franca/python-lingua-franca.spec
index 362413f..362413f 100644
--- a/mycroft/python-lingua-franca.spec
+++ b/mycroft/python-lingua-franca/python-lingua-franca.spec
diff --git a/mycroft/python-msk.spec b/mycroft/python-msk/python-msk.spec
index b4239b0..b4239b0 100644
--- a/mycroft/python-msk.spec
+++ b/mycroft/python-msk/python-msk.spec
diff --git a/mycroft/msm-no-sudo-pip.patch b/mycroft/python-msm/msm-no-sudo-pip.patch
index c87a66e..c87a66e 100644
--- a/mycroft/msm-no-sudo-pip.patch
+++ b/mycroft/python-msm/msm-no-sudo-pip.patch
diff --git a/mycroft/python-msm.spec b/mycroft/python-msm/python-msm.spec
index 43a9f80..43a9f80 100644
--- a/mycroft/python-msm.spec
+++ b/mycroft/python-msm/python-msm.spec
diff --git a/mycroft/python-padaos.spec b/mycroft/python-padaos/python-padaos.spec
index 50ecab6..50ecab6 100644
--- a/mycroft/python-padaos.spec
+++ b/mycroft/python-padaos/python-padaos.spec
diff --git a/mycroft/python-padatious.spec b/mycroft/python-padatious/python-padatious.spec
index 105c808..105c808 100644
--- a/mycroft/python-padatious.spec
+++ b/mycroft/python-padatious/python-padatious.spec
diff --git a/mycroft/python-pako.spec b/mycroft/python-pako/python-pako.spec
index fdef071..fdef071 100644
--- a/mycroft/python-pako.spec
+++ b/mycroft/python-pako/python-pako.spec
diff --git a/mycroft/python-petact.spec b/mycroft/python-petact/python-petact.spec
index 135d006..135d006 100644
--- a/mycroft/python-petact.spec
+++ b/mycroft/python-petact/python-petact.spec
diff --git a/mycroft/python-pocketsphinx.spec b/mycroft/python-pocketsphinx/python-pocketsphinx.spec
index fbf35fc..fbf35fc 100644
--- a/mycroft/python-pocketsphinx.spec
+++ b/mycroft/python-pocketsphinx/python-pocketsphinx.spec
diff --git a/mycroft/python-precise-runner.spec b/mycroft/python-precise-runner/python-precise-runner.spec
index de6eb5b..de6eb5b 100644
--- a/mycroft/python-precise-runner.spec
+++ b/mycroft/python-precise-runner/python-precise-runner.spec
diff --git a/mycroft/generate-SpeechRecognition-tarball.sh b/mycroft/python-speech_recognition/generate-SpeechRecognition-tarball.sh
index 31d1469..31d1469 100755
--- a/mycroft/generate-SpeechRecognition-tarball.sh
+++ b/mycroft/python-speech_recognition/generate-SpeechRecognition-tarball.sh
diff --git a/mycroft/python-speech_recognition.spec b/mycroft/python-speech_recognition/python-speech_recognition.spec
index b402f80..b402f80 100644
--- a/mycroft/python-speech_recognition.spec
+++ b/mycroft/python-speech_recognition/python-speech_recognition.spec
diff --git a/mycroft/speech_recognition-3.8.1-no-bundling.tar.gz b/mycroft/python-speech_recognition/speech_recognition-3.8.1-no-bundling.tar.gz
index b4c5fa9..b4c5fa9 100644
--- a/mycroft/speech_recognition-3.8.1-no-bundling.tar.gz
+++ b/mycroft/python-speech_recognition/speech_recognition-3.8.1-no-bundling.tar.gz
Binary files differ
diff --git a/mycroft/generate-xxhash-tarball.sh b/mycroft/python-xxhash/generate-xxhash-tarball.sh
index 755d5c4..755d5c4 100755
--- a/mycroft/generate-xxhash-tarball.sh
+++ b/mycroft/python-xxhash/generate-xxhash-tarball.sh
diff --git a/mycroft/python-xxhash-1.4.3-no-bundling.tar.gz b/mycroft/python-xxhash/python-xxhash-1.4.3-no-bundling.tar.gz
index 2ab91de..2ab91de 100644
--- a/mycroft/python-xxhash-1.4.3-no-bundling.tar.gz
+++ b/mycroft/python-xxhash/python-xxhash-1.4.3-no-bundling.tar.gz
Binary files differ
diff --git a/mycroft/python-xxhash.spec b/mycroft/python-xxhash/python-xxhash.spec
index ec08468..ec08468 100644
--- a/mycroft/python-xxhash.spec
+++ b/mycroft/python-xxhash/python-xxhash.spec