Code

fixed indenting
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Thu, 5 Jun 2008 19:57:25 +0000 (19:57 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Thu, 5 Jun 2008 19:57:25 +0000 (19:57 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1398 a5681a0c-68f1-0310-ab6d-d61299d08faa

program/bindings/python/rrdtoolmodule.c

index 37810f7c08fc47edb560ba9cd08c19d74d6a490e..4d3a0d57e031d23f2af1d58eb69f0424e26114a8 100644 (file)
@@ -407,14 +407,16 @@ static PyObject *PyDict_FromInfo(
     info_t *data)
 {
     PyObject *r;
+
     r = PyDict_New();
-    while (data){
+    while (data) {
         PyObject *val = NULL;
+
         switch (data->type) {
         case RD_I_VAL:
-            val = isnan(data->value.u_val)     
-                    ? (Py_INCREF(Py_None), Py_None)     
-                    : PyFloat_FromDouble(data->value.u_val);
+            val = isnan(data->value.u_val)
+                ? (Py_INCREF(Py_None), Py_None)
+                : PyFloat_FromDouble(data->value.u_val);
             break;
         case RD_I_CNT:
             val = PyLong_FromUnsignedLong(data->value.u_cnt);
@@ -426,11 +428,13 @@ static PyObject *PyDict_FromInfo(
             val = PyString_FromString(data->value.u_str);
             break;
         case RD_I_BLO:
-            val = PyString_FromStringAndSize((char*)data->value.u_blo.ptr, data->value.u_blo.size);
+            val =
+                PyString_FromStringAndSize((char *) data->value.u_blo.ptr,
+                                           data->value.u_blo.size);
             break;
         }
-        if (val){
-            PyDict_SetItemString(r,data->key,val);
+        if (val) {
+            PyDict_SetItemString(r, data->key, val);
         }
         data = data->next;
     }
@@ -449,9 +453,9 @@ static PyObject *PyRRD_info(
     char    **argv;
     info_t   *data;
 
-    if (create_args("info", args, &argc, &argv) < 0)  
+    if (create_args("info", args, &argc, &argv) < 0)
         return NULL;
-     
+
     if ((data = rrd_info(argc, argv)) == NULL) {
         PyErr_SetString(ErrorObject, rrd_get_error());
         rrd_clear_error();
@@ -474,9 +478,9 @@ static PyObject *PyRRD_graphv(
     char    **argv;
     info_t   *data;
 
-    if (create_args("graphv", args, &argc, &argv) < 0)  
+    if (create_args("graphv", args, &argc, &argv) < 0)
         return NULL;
-     
+
     if ((data = rrd_graph_v(argc, argv)) == NULL) {
         PyErr_SetString(ErrorObject, rrd_get_error());
         rrd_clear_error();
@@ -499,9 +503,9 @@ static PyObject *PyRRD_updatev(
     char    **argv;
     info_t   *data;
 
-    if (create_args("updatev", args, &argc, &argv) < 0)  
+    if (create_args("updatev", args, &argc, &argv) < 0)
         return NULL;
-     
+
     if ((data = rrd_update_v(argc, argv)) == NULL) {
         PyErr_SetString(ErrorObject, rrd_get_error());
         rrd_clear_error();