pcp
[Top] [All Lists]

Python PMAPI: Drop incomplete GUI mode support

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: Python PMAPI: Drop incomplete GUI mode support
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Sun, 26 Jun 2016 16:46:57 +0300
Delivered-to: pcp@xxxxxxxxxxx
Organization: Red Hat
Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0
Hi,

As briefly discussed at the BZ below, here's a patch to drop the
currently incomplete and non-functional GUI mode support from the
Python PMAPI. Completing it would require a non-trivial amount of work,
there's been no strong need for it to be finished, and the current
pmapi.py gives false image it being usable. Of course, if someone wants
to work on this in the future the effort can be started by reverting
this patch.

https://bugzilla.redhat.com/show_bug.cgi?id=1289910

(This is on top of the previous local context patch.)

---
 qa/src/test_pcp_getopts.python |  2 --
 qa/src/test_pcp_options.python |  2 --
 src/pmrep/TODO                 |  5 ++---
 src/pmrep/pmrep.py             |  1 -
 src/python/pcp/pmapi.py        |  8 ++++----
 src/python/pcp/pmgui.py        | 41 -----------------------------------------
 src/python/pmapi.c             | 20 --------------------
 7 files changed, 6 insertions(+), 73 deletions(-)

diff --git a/qa/src/test_pcp_getopts.python b/qa/src/test_pcp_getopts.python
index 720ff94..788ca9a 100755
--- a/qa/src/test_pcp_getopts.python
+++ b/qa/src/test_pcp_getopts.python
@@ -28,13 +28,11 @@ options.pmSetLongOptionHeader("General Options")
 options.pmSetLongOptionAlign()
 options.pmSetLongOptionArchive()
 options.pmSetLongOptionDebug()
-options.pmSetLongOptionGuiMode()
 options.pmSetLongOptionHost()
 options.pmSetLongOptionHostsFile()
 options.pmSetLongOptionSpecLocal()
 options.pmSetLongOptionLocalPMDA()
 options.pmSetLongOptionOrigin()
-options.pmSetLongOptionGuiPort()
 options.pmSetLongOptionStart()
 options.pmSetLongOptionSamples()
 options.pmSetLongOptionFinish()
diff --git a/qa/src/test_pcp_options.python b/qa/src/test_pcp_options.python
index f45ddba..4a40b63 100755
--- a/qa/src/test_pcp_options.python
+++ b/qa/src/test_pcp_options.python
@@ -39,13 +39,11 @@ options.pmSetLongOptionHeader("General Options")
 options.pmSetLongOptionAlign()
 options.pmSetLongOptionArchive()
 options.pmSetLongOptionDebug()
-options.pmSetLongOptionGuiMode()
 options.pmSetLongOptionHost()
 options.pmSetLongOptionHostsFile()
 options.pmSetLongOptionSpecLocal()
 options.pmSetLongOptionLocalPMDA()
 options.pmSetLongOptionOrigin()
-options.pmSetLongOptionGuiPort()
 options.pmSetLongOptionStart()
 options.pmSetLongOptionSamples()
 options.pmSetLongOptionFinish()
diff --git a/src/pmrep/TODO b/src/pmrep/TODO
index 3d30f81..805be88 100644
--- a/src/pmrep/TODO
+++ b/src/pmrep/TODO
@@ -15,7 +15,6 @@
 -  possibly add more command line switch sanity checking
 -  modularize code to allow creating custom output plugins
 -    (e.g. pcp2graphite type socket, top-like output, separate pcp2zabbix)
--  pmtime support (?) [-g]
 -  per-metric precision (?)
 -  copy metric set spec support (?)
 -  includedir config file support (?)
@@ -32,7 +31,7 @@ In use / reserved cmd line options:
 AaBbcCdDeEfFGhHKLloOpPqQrsStTuUVwxyYzZ
 
 Tentatively planned:
-IigkMmR
+IikMmR
 
 Available:
-JjNnXvW
+gJjNnXvW
diff --git a/src/pmrep/pmrep.py b/src/pmrep/pmrep.py
index 548b8f4..b0dc282 100755
--- a/src/pmrep/pmrep.py
+++ b/src/pmrep/pmrep.py
@@ -258,7 +258,6 @@ class PMReporter(object):
         opts.pmSetLongOption("output", 1, "o", "OUTPUT", "output target: 
archive, csv, stdout (default), or zabbix")
         opts.pmSetLongOption("output-file", 1, "F", "OUTFILE", "output file")
         opts.pmSetLongOption("derived", 1, "e", "FILE|DFNT", "derived metrics 
definitions")
-        #opts.pmSetLongOptionGuiMode()     # -g/--guimode # RHBZ#1289910
         opts.pmSetLongOptionDebug()        # -D/--debug
         opts.pmSetLongOptionVersion()      # -V/--version
         opts.pmSetLongOptionHelp()         # -?/--help
diff --git a/src/python/pcp/pmapi.py b/src/python/pcp/pmapi.py
index b2d7070..f30b4c7 100644
--- a/src/python/pcp/pmapi.py
+++ b/src/python/pcp/pmapi.py
@@ -931,8 +931,8 @@ class pmOptions(object):
         return c_api.pmSetLongOptionDebug()
 
     def pmSetLongOptionGuiMode(self):
-        """ Add support for -g/--guimode into PMAPI monitor tool """
-        return c_api.pmSetLongOptionGuiMode()
+        """ Unimplemented """
+        return None
 
     def pmSetLongOptionHost(self):
         """ Add support for -h/--host into PMAPI monitor tool """
@@ -955,8 +955,8 @@ class pmOptions(object):
         return c_api.pmSetLongOptionOrigin()
 
     def pmSetLongOptionGuiPort(self):
-        """ Add support for -p/--guiport into PMAPI monitor tool """
-        return c_api.pmSetLongOptionGuiPort()
+        """ Unimplemented """
+        return None
 
     def pmSetLongOptionStart(self):
         """ Add support for -S/--start into PMAPI monitor tool """
diff --git a/src/python/pcp/pmgui.py b/src/python/pcp/pmgui.py
index e9b6df7..bb4edec 100644
--- a/src/python/pcp/pmgui.py
+++ b/src/python/pcp/pmgui.py
@@ -76,42 +76,6 @@ LIBPCP_GUI.pmRecordControl.restype = c_int
 LIBPCP_GUI.pmRecordControl.argtypes = [POINTER(pmRecordHost), c_int, c_char_p]
 
 
-
-#LIBPCP_GUI.pmTimeConnect.restype = c_int
-#LIBPCP_GUI.pmTimeConnect.argtypes = [ ]
-
-#LIBPCP_GUI.pmTimeDisconnect.restype = c_int
-#LIBPCP_GUI.pmTimeDisconnect.argtypes = [ ]
-
-#LIBPCP_GUI.pmTimeGetPort.restype = c_int
-#LIBPCP_GUI.pmTimeGetPort.argtypes = [ ]
-
-#LIBPCP_GUI.pmTimeRecv.restype = c_int
-#LIBPCP_GUI.pmTimeRecv.argtypes = [ ]
-
-#LIBPCP_GUI.pmTimeSendAck.restype = c_int
-#LIBPCP_GUI.pmTimeSendAck.argtypes = [ ]
-
-#LIBPCP_GUI.pmTimeSendBounds.restype = c_int
-#LIBPCP_GUI.pmTimeSendBounds.argtypes = [ ]
-
-#LIBPCP_GUI.pmTimeSendMode.restype = c_int
-#LIBPCP_GUI.pmTimeSendMode.argtypes = [ ]
-
-#LIBPCP_GUI.pmTimeSendPosition.restype = c_int
-#LIBPCP_GUI.pmTimeSendPosition.argtypes = [ ]
-
-#LIBPCP_GUI.pmTimeSendTimezone.restype = c_int
-#LIBPCP_GUI.pmTimeSendTimezone.argtypes = [ ]
-
-#LIBPCP_GUI.pmTimeShowDialog.restype = c_int
-#LIBPCP_GUI.pmTimeShowDialog.argtypes = [ ]
-
-#LIBPCP_GUI.pmTimeGetStatePixmap.restype = c_int
-#LIBPCP_GUI.pmTimeGetStatePixmap.argtypes = [ ]
-
-
-
 ##############################################################################
 #
 # class GuiClient
@@ -177,8 +141,3 @@ class GuiClient(object):
             raise pmErr(status)
         return status
 
-    ##
-    # GUI API Time Control Services
-    # (Not Yet Implemented)
-
-
diff --git a/src/python/pmapi.c b/src/python/pmapi.c
index 0bd33d4..57d3976 100644
--- a/src/python/pmapi.c
+++ b/src/python/pmapi.c
@@ -348,13 +348,6 @@ setLongOptionDebug(PyObject *self, PyObject *args)
 }
 
 static PyObject *
-setLongOptionGuiMode(PyObject *self, PyObject *args)
-{
-    pmLongOptions option = PMOPT_GUIMODE;
-    return addLongOptionObject(&option);
-}
-
-static PyObject *
 setLongOptionHost(PyObject *self, PyObject *args)
 {
     pmLongOptions option = PMOPT_HOST;
@@ -390,13 +383,6 @@ setLongOptionOrigin(PyObject *self, PyObject *args)
 }
 
 static PyObject *
-setLongOptionGuiPort(PyObject *self, PyObject *args)
-{
-    pmLongOptions option = PMOPT_GUIPORT;
-    return addLongOptionObject(&option);
-}
-
-static PyObject *
 setLongOptionStart(PyObject *self, PyObject *args)
 {
     pmLongOptions option = PMOPT_START;
@@ -1217,9 +1203,6 @@ static PyMethodDef methods[] = {
     { .ml_name = "pmSetLongOptionDebug",
        .ml_meth = (PyCFunction) setLongOptionDebug,
         .ml_flags = METH_NOARGS },
-    { .ml_name = "pmSetLongOptionGuiMode",
-       .ml_meth = (PyCFunction) setLongOptionGuiMode,
-        .ml_flags = METH_NOARGS },
     { .ml_name = "pmSetLongOptionHost",
        .ml_meth = (PyCFunction) setLongOptionHost,
         .ml_flags = METH_NOARGS },
@@ -1238,9 +1221,6 @@ static PyMethodDef methods[] = {
     { .ml_name = "pmSetLongOptionOrigin",
        .ml_meth = (PyCFunction) setLongOptionOrigin,
         .ml_flags = METH_NOARGS },
-    { .ml_name = "pmSetLongOptionGuiPort",
-       .ml_meth = (PyCFunction) setLongOptionGuiPort,
-        .ml_flags = METH_NOARGS },
     { .ml_name = "pmSetLongOptionStart",
        .ml_meth = (PyCFunction) setLongOptionStart,
         .ml_flags = METH_NOARGS },

Thanks,

-- 
Marko Myllynen

<Prev in Thread] Current Thread [Next in Thread>