Merge lp:~pitti/software-center/gi-fixes into lp:software-center

Proposed by Martin Pitt on 2011-08-19
Status: Merged
Merged at revision: 2136
Proposed branch: lp:~pitti/software-center/gi-fixes
Merge into: lp:software-center
Diff against target: 125 lines (+29/-6)
6 files modified
debian/changelog (+4/-0)
softwarecenter/backend/aptchannels.py (+6/-1)
softwarecenter/backend/aptd.py (+7/-1)
softwarecenter/backend/weblive.py (+5/-1)
softwarecenter/db/history_impl/apthistory.py (+1/-2)
softwarecenter/db/update.py (+6/-1)
To merge this branch: bzr merge lp:~pitti/software-center/gi-fixes
Reviewer Review Type Date Requested Status
Michael Vogt 2011-08-19 Pending
Review via email: mp+72152@code.launchpad.net

Description of the change

More gobject/GObject fixes.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-08-19 07:57:36 +0000
3+++ debian/changelog 2011-08-19 08:26:37 +0000
4@@ -26,6 +26,10 @@
5 - show channel selector on button-press-event instead of
6 button-release-event for consistent menu behaviour (LP: #828317)
7
8+ [ Martin Pitt ]
9+ * Fix some more places which need to conditionally import gobject or
10+ GObject. (LP: #829186)
11+
12 -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 19 Aug 2011 09:38:46 +0200
13
14 software-center (4.1.16) oneiric; urgency=low
15
16=== modified file 'softwarecenter/backend/aptchannels.py'
17--- softwarecenter/backend/aptchannels.py 2011-08-05 15:32:20 +0000
18+++ softwarecenter/backend/aptchannels.py 2011-08-19 08:26:37 +0000
19@@ -18,9 +18,14 @@
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
22 import os
23-from gi.repository import GObject
24 import logging
25 import xapian
26+import sys
27+
28+if 'gobject' in sys.modules:
29+ import gobject as GObject
30+else:
31+ from gi.repository import GObject
32
33 from aptsources.sourceslist import SourceEntry, SourcesList
34
35
36=== modified file 'softwarecenter/backend/aptd.py'
37--- softwarecenter/backend/aptd.py 2011-08-17 09:11:49 +0000
38+++ softwarecenter/backend/aptd.py 2011-08-19 08:26:37 +0000
39@@ -18,10 +18,16 @@
40
41 import apt_pkg
42 import dbus
43-from gi.repository import GObject
44 import logging
45 import os
46 import re
47+import sys
48+
49+if 'gobject' in sys.modules:
50+ import gobject as GObject
51+else:
52+ from gi.repository import GObject
53+
54 from softwarecenter.utils import (sources_filename_from_ppa_entry,
55 release_filename_in_lists_from_deb_line,
56 obfuscate_private_ppa_details,
57
58=== modified file 'softwarecenter/backend/weblive.py'
59--- softwarecenter/backend/weblive.py 2011-08-09 08:47:43 +0000
60+++ softwarecenter/backend/weblive.py 2011-08-19 08:26:37 +0000
61@@ -22,13 +22,17 @@
62 # and put into weblive_pristine.py
63
64 import re
65-from gi.repository import GObject
66 import os
67 import random
68 import subprocess
69 import string
70 import imp
71+import sys
72
73+if 'gobject' in sys.modules:
74+ import gobject as GObject
75+else:
76+ from gi.repository import GObject
77 from threading import Thread, Event
78 from weblive_pristine import WebLive
79 import softwarecenter.paths
80
81=== modified file 'softwarecenter/db/history_impl/apthistory.py'
82--- softwarecenter/db/history_impl/apthistory.py 2011-08-13 08:50:01 +0000
83+++ softwarecenter/db/history_impl/apthistory.py 2011-08-19 08:26:37 +0000
84@@ -17,8 +17,6 @@
85 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
86
87
88-from gi.repository import GObject
89-
90 import apt_pkg
91 apt_pkg.init_config()
92
93@@ -27,6 +25,7 @@
94 import gzip
95 import os.path
96 import logging
97+import gobject as GObject
98
99 try:
100 import cPickle as pickle
101
102=== modified file 'softwarecenter/db/update.py'
103--- softwarecenter/db/update.py 2011-08-18 16:36:07 +0000
104+++ softwarecenter/db/update.py 2011-08-19 08:26:37 +0000
105@@ -18,7 +18,6 @@
106 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
107
108 import base64
109-from gi.repository import GObject
110 import logging
111 import os
112 import json
113@@ -26,6 +25,12 @@
114 import shutil
115 import time
116 import xapian
117+import sys
118+
119+if 'gobject' in sys.modules:
120+ import gobject as GObject
121+else:
122+ from gi.repository import GObject
123
124 # py3 compat
125 try: