bigboard r7396 - in trunk/bigboard: . stocks/mail



Author: marinaz
Date: Fri Jun 20 18:37:31 2008
New Revision: 7396
URL: http://svn.gnome.org/viewvc/bigboard?rev=7396&view=rev

Log:
Remove unused files. 

Remove custom keyring functions from bignative. 


Removed:
   trunk/bigboard/accounts.py
   trunk/bigboard/keyring.py
   trunk/bigboard/stocks/mail/lgconstants.py
   trunk/bigboard/stocks/mail/libgmail_patched.py
Modified:
   trunk/bigboard/bigboard-native.c
   trunk/bigboard/bigboard-native.h
   trunk/bigboard/bignative.c
   trunk/bigboard/google.py

Modified: trunk/bigboard/bigboard-native.c
==============================================================================
--- trunk/bigboard/bigboard-native.c	(original)
+++ trunk/bigboard/bigboard-native.c	Fri Jun 20 18:37:31 2008
@@ -12,8 +12,6 @@
 #define NO_IMPORT_PYGOBJECT
 #include <pygobject.h>
 
-#include <gnome-keyring.h>
-
 #include <gtk/gtk.h>
 
 static PyObject *logging_cb = NULL;
@@ -143,101 +141,6 @@
     return result;
 }
 
-/* gnome-keyring stuff here is because find_items_sync() is broken in the official bindings */
-
-static GnomeKeyringAttributeList *
-bigboard_pygnome_keyring_attribute_list_from_pyobject(PyObject *py_attrlist)
-{
-    GnomeKeyringAttributeList *attrlist;
-    int iter = 0; /* Unfortunately this is supposed to be Py_ssize_t with newer python I think, but using ssize_t or gssize or long just warns on this version I'm using */
-    PyObject *key, *value;
-    
-    if (!PyDict_Check(py_attrlist)) {
-        PyErr_SetString(PyExc_TypeError, "dict expected for attribute list parameter");
-        return NULL;
-    }
-
-    attrlist = gnome_keyring_attribute_list_new();
-    while (PyDict_Next(py_attrlist, &iter, &key, &value)) {
-        char *name;
-        if (!PyString_Check(key)) {
-            PyErr_SetString(PyExc_TypeError, "dict keys must be strings, when converting attribute list parameter");
-            gnome_keyring_attribute_list_free(attrlist);
-            return NULL;
-        }
-        name = PyString_AsString(key);
-        if (PyInt_Check(value))
-            gnome_keyring_attribute_list_append_uint32(attrlist, name,
-                                                       PyInt_AsLong(value));
-        else if (PyLong_Check(value)) {
-            gnome_keyring_attribute_list_append_uint32(attrlist, name,
-                                                       PyLong_AsUnsignedLong(value));
-            if (PyErr_Occurred()) {
-                gnome_keyring_attribute_list_free(attrlist);
-                return NULL;
-            }
-        }
-        else if (PyString_Check(value))
-            gnome_keyring_attribute_list_append_string(attrlist, name,
-                                                       PyString_AsString(value));
-        else {
-            PyErr_SetString(PyExc_TypeError, "dict values must be strings, ints or longs,"
-                            " when converting attribute list parameter");
-            gnome_keyring_attribute_list_free(attrlist);
-            return NULL;
-        }
-    }
-    return attrlist;
-}
-
-PyObject*
-bigboard_gnomekeyring_find_items_sync(PyObject *self, PyObject *args, PyObject *kwargs)
-{
-    static char *kwlist[] = { "type", "attributes", NULL };
-    PyObject *py_type = NULL;
-    GnomeKeyringAttributeList * attributes;
-    int type; /* GnomeKeyringItemType */
-    gint ret;
-    PyObject * py_attributes = NULL;
-    GList *found = NULL, *l;
-    PyObject *py_found;
-    GType keyring_found_type;
-    
-    keyring_found_type = g_type_from_name("PyGnomeKeyringFound");
-    if (keyring_found_type == 0) {
-        PyErr_SetString(PyExc_RuntimeError, "gnome-keyring python types not registered");
-        return NULL;
-    }
-        
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"OO:find_items_sync", kwlist, &py_type, &py_attributes))
-        return NULL;
-    if (pyg_enum_get_value(G_TYPE_NONE, py_type, &type))
-        return NULL;
-    attributes = bigboard_pygnome_keyring_attribute_list_from_pyobject(py_attributes);
-    if (!attributes)
-        return NULL;
-    pyg_begin_allow_threads;
-    ret = gnome_keyring_find_items_sync(type, attributes, &found);
-    pyg_end_allow_threads;
-    gnome_keyring_attribute_list_free(attributes);
-
-    py_found = PyList_New(0);
-    for (l = found; l; l = l->next)
-    {
-        PyObject *item = pyg_boxed_new(keyring_found_type, l->data, FALSE, TRUE);
-        PyList_Append(py_found, item);
-        Py_DECREF(item);
-    }
-    g_list_free(found);
-
-    if (ret == GNOME_KEYRING_RESULT_OK) {
-        return py_found;
-    } else {
-        PyErr_SetString(PyExc_TypeError, "gnome-keyring returned not OK (TypeError is just bogus, ignore that)");
-        return NULL;
-    }
-}
-
 PyObject*
 bigboard_utf8_collate(PyObject *self, PyObject *args)
 {

Modified: trunk/bigboard/bigboard-native.h
==============================================================================
--- trunk/bigboard/bigboard-native.h	(original)
+++ trunk/bigboard/bigboard-native.h	Fri Jun 20 18:37:31 2008
@@ -10,7 +10,6 @@
 PyObject * bigboard_set_log_handler			(PyObject *self, PyObject *func);
 PyObject*  bigboard_set_application_name                (PyObject *self, PyObject *args);
 PyObject*  bigboard_set_program_name                    (PyObject *self, PyObject *args);
-PyObject*  bigboard_gnomekeyring_find_items_sync        (PyObject *self, PyObject *args, PyObject *kwargs);
 PyObject*  bigboard_install_focus_docks_hack            (PyObject *self, PyObject *args);
 PyObject*  bigboard_utf8_collate                        (PyObject *self, PyObject *args);
 

Modified: trunk/bigboard/bignative.c
==============================================================================
--- trunk/bigboard/bignative.c	(original)
+++ trunk/bigboard/bignative.c	Fri Jun 20 18:37:31 2008
@@ -20,8 +20,6 @@
      "Set the GLib program name."},
     {"install_focus_docks_hack", bigboard_install_focus_docks_hack, METH_VARARGS,
      "Focus dock windows when clicking focusable widgets in them."},    
-    {"keyring_find_items_sync", (PyCFunction) bigboard_gnomekeyring_find_items_sync, METH_VARARGS | METH_KEYWORDS,
-     "Find gnomekeyring items."},
     {"utf8_collate", (PyCFunction) bigboard_utf8_collate, METH_VARARGS,
      "Compare strings in lexical order."},
     {NULL, NULL, 0, NULL}        /* Sentinel */
@@ -35,11 +33,4 @@
     
     m = Py_InitModule("bignative", bignative_functions);
     d = PyModule_GetDict(m);
-
-    /* Our gnome-keyring workaround depends on the gnomekeyring native types being
-     * registered first, so we import here to force that. This leaks a reference
-     * the loaded module, but module couldn't be unloaded anyways, since it registers
-     * GObject types, so that shouldn't matter.
-     */
-    PyImport_ImportModule("gnomekeyring");
 }

Modified: trunk/bigboard/google.py
==============================================================================
--- trunk/bigboard/google.py	(original)
+++ trunk/bigboard/google.py	Fri Jun 20 18:37:31 2008
@@ -672,10 +672,6 @@
     bignative.set_application_name("BigBoard")
     bignative.set_program_name("bigboard")
 
-    # to test, you have to change this temporarily to store your correct
-    # password, then comment it out again.
-    # keyring.get_keyring().store_login('google', 'hp redhat com', 'wrong')
-
     #AuthDialog().present('foo', 'bar')
     #gtk.main()
     #sys.exit(0)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]