From 241d21068ca7c95b5722250d95bed28c3f984e01 Mon Sep 17 00:00:00 2001
From: Giorgos Korfiatis <gkorf@grnet.gr>
Date: Tue, 19 May 2015 11:30:27 +0300
Subject: [PATCH] Separate scripts of cli and gui

---
 agkyra-cli           | 35 +++++++++++++++++++++++++++++++++++
 launch => agkyra-gui |  5 -----
 2 files changed, 35 insertions(+), 5 deletions(-)
 create mode 100755 agkyra-cli
 rename launch => agkyra-gui (89%)

diff --git a/agkyra-cli b/agkyra-cli
new file mode 100755
index 0000000..6306b42
--- /dev/null
+++ b/agkyra-cli
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+
+# Copyright (C) 2015 GRNET S.A.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import os
+
+from agkyra import config
+AGKYRA_DIR = config.AGKYRA_DIR
+
+import logging
+LOGFILE = os.path.join(AGKYRA_DIR, 'agkyra.log')
+LOGGER = logging.getLogger('agkyra')
+HANDLER = logging.FileHandler(LOGFILE)
+FORMATTER = logging.Formatter("%(levelname)s:%(asctime)s:%(message)s")
+HANDLER.setFormatter(FORMATTER)
+LOGGER.addHandler(HANDLER)
+LOGGER.setLevel(logging.INFO)
+
+# run cli
+from agkyra.cli import AgkyraCLI
+from sys import argv
+AgkyraCLI().onecmd(' '.join(argv[1:] or ['help', ]))
diff --git a/launch b/agkyra-gui
similarity index 89%
rename from launch
rename to agkyra-gui
index 03fb63f..6321340 100755
--- a/launch
+++ b/agkyra-gui
@@ -32,8 +32,3 @@ LOGGER.setLevel(logging.INFO)
 # # run GUI
 from agkyra import gui
 gui.run()
-
-# run cli
-# from agkyra.cli import AgkyraCLI
-# from sys import argv
-# AgkyraCLI().onecmd(' '.join(argv[1:] or ['help', ]))
-- 
GitLab