Skip to content

Commit f4e5e61

Browse files
author
djosg
committed
New version for gobject introspection and python 3 update.
Not well tested.
1 parent 1a31379 commit f4e5e61

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

.gitmetadata

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
{'st_mtime': '1410429609', 'st_mode': '33188', 'st_uid': '1000', 'st_gid': '1000', 'st_nlink': '1', 'st_size': '9041'} ; plugin/gir_build/qofinstance_edit.h
122122
{'st_mtime': '1413111496', 'st_mode': '33188', 'st_uid': '1000', 'st_gid': '1000', 'st_nlink': '1', 'st_size': '6939'} ; plugin/gir_build/swighelpers.c
123123
{'st_mtime': '1480787502', 'st_mode': '33188', 'st_uid': '1000', 'st_gid': '1000', 'st_nlink': '1', 'st_size': '758'} ; plugin/gir_build/timespec.h
124-
{'st_mtime': '1400106444', 'st_mode': '33204', 'st_uid': '1000', 'st_gid': '1000', 'st_nlink': '1', 'st_size': '33027'} ; pygkeyfile.c
124+
{'st_mtime': '1530881387', 'st_mode': '33204', 'st_uid': '1000', 'st_gid': '1000', 'st_nlink': '1', 'st_size': '33024'} ; pygkeyfile.c
125125
{'st_mtime': '1530367609', 'st_mode': '33188', 'st_uid': '1000', 'st_gid': '1000', 'st_nlink': '1', 'st_size': '5212'} ; pygobjectcapi.py
126126
{'st_mtime': '1480544003', 'st_mode': '33188', 'st_uid': '1000', 'st_gid': '1000', 'st_nlink': '1', 'st_size': '7880'} ; python_menu_extensions.py
127127
{'st_mtime': '1480599206', 'st_mode': '33188', 'st_uid': '1000', 'st_gid': '1000', 'st_nlink': '1', 'st_size': '10556'} ; python_only_plugin.py

pygkeyfile.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pyg_key_file_load_from_data_dirs(PyGKeyFile *self, PyObject *args, PyObject *kwa
141141
return NULL;
142142

143143
if (ret)
144-
return PyString_FromString(full_path);
144+
return PyUnicode_FromString(full_path);
145145

146146
Py_INCREF(Py_None);
147147
return Py_None;
@@ -160,7 +160,7 @@ pyg_key_file_to_data(PyGKeyFile *self)
160160
return NULL;
161161

162162
if (ret)
163-
return PyString_FromString(ret);
163+
return PyUnicode_FromString(ret);
164164

165165
Py_INCREF(Py_None);
166166
return Py_None;
@@ -174,7 +174,7 @@ pyg_key_file_get_start_group(PyGKeyFile *self)
174174
ret = g_key_file_get_start_group(self->key_file);
175175

176176
if (ret)
177-
return PyString_FromString(ret);
177+
return PyUnicode_FromString(ret);
178178

179179
Py_INCREF(Py_None);
180180
return Py_None;
@@ -197,7 +197,7 @@ pyg_key_file_get_groups(PyGKeyFile *self)
197197

198198
py_ret = PyTuple_New(i);
199199
for (j = 0; j < i; j++)
200-
PyTuple_SetItem(py_ret, j, PyString_FromString(ret[j]));
200+
PyTuple_SetItem(py_ret, j, PyUnicode_FromString(ret[j]));
201201
return py_ret;
202202
}
203203
Py_INCREF(Py_None);
@@ -231,7 +231,7 @@ pyg_key_file_get_keys(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
231231

232232
py_ret = PyTuple_New(i);
233233
for (j = 0; j < i; j++)
234-
PyTuple_SetItem(py_ret, j, PyString_FromString(ret[j]));
234+
PyTuple_SetItem(py_ret, j, PyUnicode_FromString(ret[j]));
235235
return py_ret;
236236
}
237237
Py_INCREF(Py_None);
@@ -302,7 +302,7 @@ pyg_key_file_get_value(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
302302
return NULL;
303303

304304
if (ret)
305-
return PyString_FromString(ret);
305+
return PyUnicode_FromString(ret);
306306

307307
Py_INCREF(Py_None);
308308
return Py_None;
@@ -327,7 +327,7 @@ pyg_key_file_get_string(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
327327
return NULL;
328328

329329
if (ret)
330-
return PyString_FromString(ret);
330+
return PyUnicode_FromString(ret);
331331

332332
Py_INCREF(Py_None);
333333
return Py_None;
@@ -353,7 +353,7 @@ pyg_key_file_get_locale_string(PyGKeyFile *self, PyObject *args, PyObject *kwarg
353353
return NULL;
354354

355355
if (ret)
356-
return PyString_FromString(ret);
356+
return PyUnicode_FromString(ret);
357357

358358
Py_INCREF(Py_None);
359359
return Py_None;
@@ -399,7 +399,7 @@ pyg_key_file_get_integer(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
399399
return NULL;
400400

401401
if (py_group != Py_None)
402-
group = PyString_AsString(py_group);
402+
group = PyUnicode_AsUTF8(py_group);
403403

404404
ret = g_key_file_get_integer(self->key_file, group, key, &error);
405405

@@ -426,7 +426,7 @@ pyg_key_file_get_double(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
426426
return NULL;
427427

428428
if (py_group != Py_None)
429-
group = PyString_AsString(py_group);
429+
group = PyUnicode_AsUTF8(py_group);
430430

431431
ret = g_key_file_get_double(self->key_file, group, key, &error);
432432

@@ -465,7 +465,7 @@ pyg_key_file_get_string_list(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
465465

466466
py_ret = PyTuple_New(i);
467467
for (j = 0; j < i; j++)
468-
PyTuple_SetItem(py_ret, j, PyString_FromString(ret[j]));
468+
PyTuple_SetItem(py_ret, j, PyUnicode_FromString(ret[j]));
469469

470470
return py_ret;
471471
}
@@ -493,8 +493,8 @@ pyg_key_file_get_locale_string_list(PyGKeyFile *self, PyObject *args, PyObject *
493493
if (py_locale == Py_None)
494494
locale = NULL;
495495

496-
if PyString_Check(py_locale)
497-
locale = PyString_AsString(py_locale);
496+
if PyUnicode_Check(py_locale)
497+
locale = PyUnicode_AsUTF8(py_locale);
498498

499499
ret = g_key_file_get_locale_string_list(self->key_file, group, key, locale, NULL, &error);
500500

@@ -508,7 +508,7 @@ pyg_key_file_get_locale_string_list(PyGKeyFile *self, PyObject *args, PyObject *
508508

509509
py_ret = PyTuple_New(i);
510510
for (j = 0; j < i; j++)
511-
PyTuple_SetItem(py_ret, j, PyString_FromString(ret[j]));
511+
PyTuple_SetItem(py_ret, j, PyUnicode_FromString(ret[j]));
512512

513513
return py_ret;
514514
}
@@ -595,7 +595,7 @@ pyg_key_file_get_double_list(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
595595
return NULL;
596596

597597
if (py_group != Py_None)
598-
group = PyString_AsString(py_group);
598+
group = PyUnicode_AsUTF8(py_group);
599599

600600
ret = g_key_file_get_double_list(self->key_file, group, key, &length, &error);
601601

@@ -626,18 +626,18 @@ pyg_key_file_get_comment(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
626626
return NULL;
627627

628628
if (py_group != Py_None)
629-
group = PyString_AsString(py_group);
629+
group = PyUnicode_AsUTF8(py_group);
630630

631631
if (py_key != Py_None)
632-
key = PyString_AsString(py_key);
632+
key = PyUnicode_AsUTF8(py_key);
633633

634634
ret = g_key_file_get_comment(self->key_file, group, key, &error);
635635

636636
if (pyg_error_check(&error))
637637
return NULL;
638638

639639
if (ret)
640-
return PyString_FromString(ret);
640+
return PyUnicode_FromString(ret);
641641

642642
Py_INCREF(Py_None);
643643
return Py_None;
@@ -754,7 +754,7 @@ pyg_key_file_set_double(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
754754
return NULL;
755755

756756
if (py_group != Py_None)
757-
group = PyString_AsString(py_group);
757+
group = PyUnicode_AsUTF8(py_group);
758758

759759
g_key_file_set_double(self->key_file, group, key, value);
760760

@@ -781,7 +781,7 @@ pyg_key_file_set_string_list(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
781781
list = g_new(gchar *, n+1);
782782
for (i = 0; i < n; i++) {
783783
PyObject *item = PySequence_GetItem(strings, i);
784-
list[i] = PyString_AsString(item);
784+
list[i] = PyUnicode_AsUTF8(item);
785785
}
786786

787787
g_key_file_set_string_list(self->key_file, group, key, (const gchar **) list, length);
@@ -810,7 +810,7 @@ pyg_key_file_set_locale_string_list(PyGKeyFile *self, PyObject *args, PyObject *
810810
list = g_new(gchar *, n+1);
811811
for (i = 0; i < n; i ++) {
812812
PyObject *item = PySequence_GetItem(strings, i);
813-
list[i] = PyString_AsString(item);
813+
list[i] = PyUnicode_AsUTF8(item);
814814
}
815815

816816
g_key_file_set_locale_string_list(self->key_file, group, key, locale, (const gchar **) list, length);
@@ -836,10 +836,10 @@ pyg_key_file_set_boolean_list(PyGKeyFile *self, PyObject *args, PyObject *kwargs
836836
return NULL;
837837

838838
if (py_key != Py_None)
839-
key = PyString_AsString(py_key);
839+
key = PyUnicode_AsUTF8(py_key);
840840

841841
if (py_group != Py_None)
842-
group = PyString_AsString(py_group);
842+
group = PyUnicode_AsUTF8(py_group);
843843

844844
n = PySequence_Size(bool_list);
845845
list = g_new(gboolean, length);
@@ -902,10 +902,10 @@ pyg_key_file_set_double_list(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
902902
return NULL;
903903

904904
if (py_key != Py_None)
905-
key = PyString_AsString(py_key);
905+
key = PyUnicode_AsUTF8(py_key);
906906

907907
if (py_group != Py_None)
908-
group = PyString_AsString(py_group);
908+
group = PyUnicode_AsUTF8(py_group);
909909

910910
n = PySequence_Size(doub_list);
911911
list = g_new(double, length);
@@ -936,10 +936,10 @@ pyg_key_file_set_comment(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
936936
return NULL;
937937

938938
if (py_key != Py_None)
939-
key = PyString_AsString(py_key);
939+
key = PyUnicode_AsUTF8(py_key);
940940

941941
if (py_group != Py_None)
942-
group = PyString_AsString(py_group);
942+
group = PyUnicode_AsUTF8(py_group);
943943

944944
g_key_file_set_comment(self->key_file, group, key, comment, &error);
945945

@@ -1004,15 +1004,15 @@ pyg_key_file_remove_comment(PyGKeyFile *self, PyObject *args, PyObject *kwargs)
10041004
return NULL;
10051005

10061006
if (py_group != Py_None) {
1007-
if (!PyString_Check(py_group))
1007+
if (!PyUnicode_Check(py_group))
10081008
return NULL;
1009-
group = PyString_AsString(py_group);
1009+
group = PyUnicode_AsUTF8(py_group);
10101010
}
10111011

10121012
if (py_key != Py_None) {
1013-
if (!PyString_Check(py_key))
1013+
if (!PyUnicode_Check(py_key))
10141014
return NULL;
1015-
key = PyString_AsString(py_key);
1015+
key = PyUnicode_AsUTF8(py_key);
10161016
}
10171017

10181018
g_key_file_remove_comment(self->key_file, group, key, &error);

0 commit comments

Comments
 (0)