From 79ebd0cb1fec749b676824e941482661f95a2d85 Mon Sep 17 00:00:00 2001 From: milerius Date: Sun, 28 Jul 2019 08:29:35 +0200 Subject: [PATCH 1/7] add begining of docs for editor --- albinos-editor/docs/technical_doc_editor.md | 43 +++++++++++++++++++++ albinos-editor/src/albinos_editor.nim | 8 ++-- albinos-editor/src/albinospkg/cli.nim | 10 ++--- albinos-editor/src/ext/replxx.nim | 3 ++ albinos-editor/src/libalbinos/albinos.nim | 3 ++ 5 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 albinos-editor/docs/technical_doc_editor.md diff --git a/albinos-editor/docs/technical_doc_editor.md b/albinos-editor/docs/technical_doc_editor.md new file mode 100644 index 0000000..a612770 --- /dev/null +++ b/albinos-editor/docs/technical_doc_editor.md @@ -0,0 +1,43 @@ +# albinos_editor + +## Prerequisites + +Below is the list of prerequisites to compile albinos-editor on your machine: + +* Nim version 0.18 minimum +* Nimble + +## Getting Started + +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. + +### Build + +To build the project please follow the instructions below: + +``` +nimble build +``` + +### Install + +To install the project please follow the instructions below: + +``` +nimble install +``` + +### Running the tests + +To run the tests for the project please follow the instructions below: + +``` +nimble test +``` + +## Architecture + +The albinos configuration editor works in a complementary way with `albinos daemon service`. + +The albinos editor binary comes with a dynamic library containing albinos API functionality, +This way when a client enters a command the function is directly called from the `DLL`. \ No newline at end of file diff --git a/albinos-editor/src/albinos_editor.nim b/albinos-editor/src/albinos_editor.nim index e947d04..79df585 100644 --- a/albinos-editor/src/albinos_editor.nim +++ b/albinos-editor/src/albinos_editor.nim @@ -1,6 +1,6 @@ import terminal import docopt -import albinospkg/gui +#import albinospkg/gui import albinospkg/cli import albinospkg/options @@ -13,9 +13,9 @@ when isMainModule: launchCLI($args["--load-config"]) else: launchCLI() - elif args["--gui"]: - styledEcho(fgCyan, "Launching GUI") - launchGUI() + #elif args["--gui"]: + # styledEcho(fgCyan, "Launching GUI") + # launchGUI() #var cfg : Config #var cfgp = addr cfg diff --git a/albinos-editor/src/albinospkg/cli.nim b/albinos-editor/src/albinospkg/cli.nim index e8e14f8..06d7378 100644 --- a/albinos-editor/src/albinospkg/cli.nim +++ b/albinos-editor/src/albinospkg/cli.nim @@ -44,7 +44,7 @@ var msgTable = englishTable proc globalHelpMsg() = var nocolor: bool = false - println(msgTable["usage"], bgr = bgDefault) + #println(msgTable["usage"], bgr = bgDefault) printLnBiCol(msgTable["help_cmd_msg"], colLeft = if nocolor == true: termwhite else: yellow, colRight = termwhite, sep = " ", xpos = 8) @@ -60,14 +60,14 @@ proc globalHelpMsg() = sep = " ", xpos = 8) printHL("", substr = "name", col = if nocolor == true: termwhite else: magenta) - printLn(" (create a config with the given name)", bgr = bgDefault) + # printLn(" (create a config with the given name)", bgr = bgDefault) printBiCol("config load", colLeft = if nocolor == true: termwhite else: yellow, colRight = if nocolor == true: termwhite else: dodgerblue, sep = " ", xpos = 8) printHL("", substr = "file", col = if nocolor == true: termwhite else: magenta) - printLn(" (load config from the key in the given file)", bgr = bgDefault) + #printLn(" (load config from the key in the given file)", bgr = bgDefault) printBiCol("setting update", colLeft = if nocolor == true: termwhite else: yellow, colRight = if nocolor == true: termwhite else: dodgerblue, @@ -76,8 +76,8 @@ proc globalHelpMsg() = true: termwhite else: magenta) printHL("", substr = "value", col = if nocolor == true: termwhite else: magenta) - printLn(" (update setting with the given name to the given value)", - bgr = bgDefault) + #printLn(" (update setting with the given name to the given value)", + # bgr = bgDefault) proc yes(question: string): bool = echo question, " (\e[93my\e[39m/\e[93mN\e[39m)" diff --git a/albinos-editor/src/ext/replxx.nim b/albinos-editor/src/ext/replxx.nim index f01a74b..71743f0 100644 --- a/albinos-editor/src/ext/replxx.nim +++ b/albinos-editor/src/ext/replxx.nim @@ -37,6 +37,9 @@ when defined(linux): const replxxdll* = "libreplxx.so" +when defined(MacOSX): + const + replxxdll* = "libreplxx.dylib" const REPLXX_VERSION* = "0.0.2" REPLXX_VERSION_MAJOR* = 0 diff --git a/albinos-editor/src/libalbinos/albinos.nim b/albinos-editor/src/libalbinos/albinos.nim index 73be2fa..69d87e8 100644 --- a/albinos-editor/src/libalbinos/albinos.nim +++ b/albinos-editor/src/libalbinos/albinos.nim @@ -7,6 +7,9 @@ when defined(linux): const albinosdll* = "libalbinos.so" +when defined(MacOSX): + const + albinosdll* = "libalbinos.dylib" ## / ## / \brief contain all possible returned values for the API ## / From 2b226b6b28c1ecbb7edf6a3268c1350d64b24499 Mon Sep 17 00:00:00 2001 From: milerius Date: Mon, 29 Jul 2019 08:57:23 +0200 Subject: [PATCH 2/7] docs: DLL -> dynamic library --- .idea/.gitignore | 2 ++ .idea/albinos.iml | 2 ++ .idea/misc.xml | 7 +++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 8 ++++++++ albinos-editor/docs/technical_doc_editor.md | 2 +- 6 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/albinos.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..5c98b42 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/.idea/albinos.iml b/.idea/albinos.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/.idea/albinos.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8822db8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..9e1f595 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..21dd5f2 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/albinos-editor/docs/technical_doc_editor.md b/albinos-editor/docs/technical_doc_editor.md index a612770..012ab70 100644 --- a/albinos-editor/docs/technical_doc_editor.md +++ b/albinos-editor/docs/technical_doc_editor.md @@ -40,4 +40,4 @@ nimble test The albinos configuration editor works in a complementary way with `albinos daemon service`. The albinos editor binary comes with a dynamic library containing albinos API functionality, -This way when a client enters a command the function is directly called from the `DLL`. \ No newline at end of file +This way when a client enters a command the function is directly called from the `dynamic library`. \ No newline at end of file From 0425bccf9a2c0f62bc6d0a12d503dae688565695 Mon Sep 17 00:00:00 2001 From: Sztergbaum Roman Date: Mon, 29 Jul 2019 12:36:34 +0200 Subject: [PATCH 3/7] Delete vcs.xml --- .idea/vcs.xml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 21dd5f2..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From 0ceb4845f39b18d49cdfda610cf0a4948ec3ac10 Mon Sep 17 00:00:00 2001 From: Sztergbaum Roman Date: Mon, 29 Jul 2019 12:36:44 +0200 Subject: [PATCH 4/7] Delete .gitignore --- .idea/.gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 5c98b42..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Default ignored files -/workspace.xml \ No newline at end of file From a87c4c35b7632695dd9203847460800ce2a95cbf Mon Sep 17 00:00:00 2001 From: Sztergbaum Roman Date: Mon, 29 Jul 2019 12:36:53 +0200 Subject: [PATCH 5/7] Delete albinos.iml --- .idea/albinos.iml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .idea/albinos.iml diff --git a/.idea/albinos.iml b/.idea/albinos.iml deleted file mode 100644 index f08604b..0000000 --- a/.idea/albinos.iml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file From 3cff287005abecb140289cc66a6b2978ff245a0c Mon Sep 17 00:00:00 2001 From: Sztergbaum Roman Date: Mon, 29 Jul 2019 12:37:01 +0200 Subject: [PATCH 6/7] Delete modules.xml --- .idea/modules.xml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/modules.xml diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 9e1f595..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From 6bde17c2a632052cb1fa8fedb7b3466f88910ad9 Mon Sep 17 00:00:00 2001 From: Sztergbaum Roman Date: Mon, 29 Jul 2019 12:37:08 +0200 Subject: [PATCH 7/7] Delete misc.xml --- .idea/misc.xml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .idea/misc.xml diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 8822db8..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file