~chromium-team/chromium-browser/artful-beta

« back to all changes in this revision

Viewing changes to debian/apport/chromium-browser.py

* Merge with chromium-browser.stable #583

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
the full text of the license.
12
12
'''
13
13
 
14
 
import os
 
14
import os, sys, getopt
15
15
import time
16
16
from stat import *
17
17
import re
43
43
    'rhythmbox-plugins',
44
44
    'totem-mozilla',
45
45
    'icedtea6-plugin',
 
46
    'moonlight-plugin-chromium',
46
47
    'sun-java6-bin',
47
48
    'acroread',
48
49
    # chrome
94
95
        report['ChromiumPrefs'] += "browser/check_default_browser = **unset** (no such key yet)\n"
95
96
 
96
97
    if 'theme' in entry['extensions']:
97
 
        report['ChromiumPrefs'] += "extensions/theme/use_system = " + \
98
 
            str(entry['extensions']['theme']['use_system']) + "\n"
 
98
        if 'use_system' in entry['extensions']['theme']:
 
99
            report['ChromiumPrefs'] += "extensions/theme/use_system = " + \
 
100
                  str(entry['extensions']['theme']['use_system']) + "\n"
 
101
        else:
 
102
            report['ChromiumPrefs'] += "extensions/theme/use_system = **unset** (no such key)\n"
99
103
 
100
104
    # list entensions+versions
101
105
    report['ChromiumPrefs'] += "extensions/settings =\n"
182
186
        s += env + " = " + str(os.getenv(env)) + "\n"
183
187
    return s
184
188
 
185
 
def add_info(report):
 
189
def add_info(report, userdir = None):
186
190
    apport.hookutils.attach_related_packages(report, RELATED_PACKAGES)
187
191
    installed_version(report, RELATED_PACKAGES)
188
192
 
192
196
        report['CrashDB'] = 'ubuntu'
193
197
 
194
198
    try:
195
 
        report['chromium-default'] = open('/etc/chromium-browser/default').read()
 
199
        fd = open('/etc/chromium-browser/default')
 
200
        report['chromium-default'] = ""
 
201
        for l in fd.readlines():
 
202
            if re.match('^(#|$)', l):
 
203
                continue
 
204
            report['chromium-default'] += l
 
205
        fd.close()
196
206
    except IOError:
197
207
        pass
198
208
 
213
223
            '/desktop/gnome/interface/icon_theme',
214
224
            '/desktop/gnome/interface/gtk_theme',
215
225
            ])
216
 
    user_dir = get_user_profile_dir(report)
 
226
    user_dir = userdir if userdir is not None else get_user_profile_dir(report)
217
227
    user_prefs(report, user_dir + "/Preferences")
218
228
 
219
229
    list_installed_plugins(report)
228
238
 
229
239
## DEBUGING ##
230
240
if __name__ == '__main__':
 
241
    try:
 
242
        opts, args = getopt.getopt(sys.argv[1:], "-u:", [ 'user-dir=' ])
 
243
    except getopt.GetoptError, err:
 
244
        print str(err)
 
245
        sys.exit(2)
 
246
 
 
247
    userdir = None
 
248
    for o, a in opts:
 
249
        if o in ("-u", "--user-dir"):
 
250
            userdir = a
 
251
        else:
 
252
          assert False, "unhandled option"
 
253
 
231
254
    report = {}
232
 
    add_info(report)
 
255
    add_info(report, userdir = userdir)
233
256
    for key in report:
234
257
        print '[%s]\n%s\n' % (key, report[key])