~ubuntu-branches/ubuntu/saucy/nautilus-python/saucy-proposed

« back to all changes in this revision

Viewing changes to src/nautilus-python.c

  • Committer: Package Import Robot
  • Author(s): Laurent Bigonville
  • Date: 2011-10-19 22:04:10 UTC
  • mfrom: (1.1.7) (7.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20111019220410-ynj2zfdo631954ix
Tags: 1.1-1
* New upstream release.
  - Transition to nautilus 3 (Closes: #637315)
* debian/control.in:
  - Adjusts {build-}dependencies
  - Bump Standards-Version to 3.9.2 (no further changes)
  - Add Vcs-* fields
* Switch to dpkg-source 3.0 (quilt) format
* debian/dirs: Create system-wide extensions directory to new location
* debian/watch: Switch to .xz tarballs
* debian/README.Debian: Update to new locations
* debian/lintian-overrides: Add an override for the empty system-wide
  extensions directory
* debian/copyright: Add missing copyright statements

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 *
15
15
 *  You should have received a copy of the GNU General Public License
16
16
 *  along with this program; if not, write to the Free Software
17
 
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
18
18
 */
19
19
 
20
20
#ifdef HAVE_CONFIG_H
45
45
static inline gboolean 
46
46
np_init_pygobject(void)
47
47
{
48
 
#ifdef Py_CAPSULE_H
49
 
                void *capsule = PyCapsule_Import("gobject._PyGObject_API", 0);
50
 
                if (capsule)
51
 
                {
52
 
                        _PyGObject_API = (struct _PyGObject_Functions*)capsule;
53
 
                        return TRUE;
54
 
                }
55
 
#endif
56
 
    PyObject *gobject = PyImport_ImportModule("gobject");
57
 
    if (gobject != NULL)
58
 
    {
59
 
        PyObject *mdict = PyModule_GetDict(gobject);
60
 
        PyObject *cobject = PyDict_GetItemString(mdict, "_PyGObject_API");
61
 
        if (PyCObject_Check(cobject))
62
 
        {
63
 
            _PyGObject_API = (struct _PyGObject_Functions *)PyCObject_AsVoidPtr(cobject);
64
 
        }
65
 
        else
66
 
        {
67
 
            PyErr_SetString(PyExc_RuntimeError,
68
 
                            "could not find _PyGObject_API object");
69
 
                        PyErr_Print();
70
 
                        return FALSE;
71
 
        }
72
 
    }
73
 
    else
74
 
    {
75
 
        PyErr_Print();
76
 
        g_warning("could not import gobject");
 
48
    PyObject *gobject = pygobject_init (PYGOBJECT_MAJOR_VERSION, PYGOBJECT_MINOR_VERSION, PYGOBJECT_MICRO_VERSION);
 
49
 
 
50
    if (gobject == NULL) {
 
51
        PyErr_Print ();
77
52
        return FALSE;
78
53
    }
 
54
 
79
55
        return TRUE;
80
56
}
81
57
 
161
137
                                {
162
138
                                        g_warning("nautilus_python_init_python failed");
163
139
                                        g_dir_close(dir);
 
140
                                        break;
164
141
                                }
165
142
                                
166
143
                                /* sys.path.insert(0, dirname) */
177
154
static gboolean
178
155
nautilus_python_init_python (void)
179
156
{
180
 
        PyObject *sys_path, *nautilus;
 
157
        PyObject *nautilus;
181
158
        GModule *libpython;
182
159
        char *argv[] = { "nautilus", NULL };
183
160