Merge lp:~hmontoliu/firefox/firefox-3.0.head into lp:firefox/3.0

Proposed by Hilario J. Montoliu (hjmf)
Status: Merged
Approved by: Alexander Sack
Approved revision: 395
Merged at revision: not available
Proposed branch: lp:~hmontoliu/firefox/firefox-3.0.head
Merge into: lp:firefox/3.0
Diff against target: None lines
To merge this branch: bzr merge lp:~hmontoliu/firefox/firefox-3.0.head
Reviewer Review Type Date Requested Status
Mozilla Team Pending
Review via email: mp+5545@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Hilario J. Montoliu (hjmf) (hmontoliu) wrote :

* debian/apport/firefox-3.0.py - removed unused code and minor refactoring.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/apport/firefox-3.0.py'
--- debian/apport/firefox-3.0.py 2008-05-13 08:55:19 +0000
+++ debian/apport/firefox-3.0.py 2009-04-14 22:36:52 +0000
@@ -18,13 +18,13 @@
1818
19import os19import os
20import ConfigParser20import ConfigParser
21import glob
22import cStringIO21import cStringIO
23from xml.dom import minidom22from xml.dom import minidom
2423
25def extensions_ini_parser(extensions_ini_file):24def extensions_ini_parser(extensions_ini_file):
26 '''parses profile's extensions.ini file and returns a tuple:25 '''parses profile's extensions.ini file and returns a tuple:
27 ((gre extensions, app extensions, local extensions), (gre themes, app themes, local themes))'''26 ((gre extensions, app extensions, local extensions), (gre themes, app
27 themes, local themes))'''
28 parser = ConfigParser.ConfigParser()28 parser = ConfigParser.ConfigParser()
29 parser.read(extensions_ini_file) 29 parser.read(extensions_ini_file)
30 ext_ini_d = {}30 ext_ini_d = {}
@@ -73,25 +73,21 @@
7373
74def extension_summary_helper(extension_list, section_name, alt_output = 1):74def extension_summary_helper(extension_list, section_name, alt_output = 1):
75 '''does some output proccessing for extensionSummary'''75 '''does some output proccessing for extensionSummary'''
76 str = ''76 summary = ''
77 if len(extension_list) > 0:77 if len(extension_list) > 0:
78 str += ''' %s:\n''' % section_name78 summary += ''' %s:\n''' % section_name
79 for extension in extension_list:79 for extension in extension_list:
80 str += ''' %s\n''' % install_ini_parser(extension)80 summary += ''' %s\n''' % install_ini_parser(extension)
81 else:81 else:
82 if alt_output == 1: # if 0, don't output anything82 if alt_output == 1: # if 0, don't output anything
83 str += ''' No %s in this Profile.\n''' % section_name 83 summary += ''' No %s in this Profile.\n''' % section_name
84 str += '''\n'''84 summary += '''\n'''
85 return str85 return summary
8686
87def add_info(report):87def add_info(report):
88 '''adds hooked infor into the apport report.'''
88 config_dir = os.path.join(os.environ['HOME'], '.mozilla', 'firefox')89 config_dir = os.path.join(os.environ['HOME'], '.mozilla', 'firefox')
89 90
90 # append pluginreg.dat file:
91 pluginreg_dat = os.path.join(config_dir,'pluginreg.dat')
92 if os.path.exists(pluginreg_dat):
93 report['pluginreg.dat'] = open(pluginreg_dat).read()
94
95 # append profiles.ini file & parse it:91 # append profiles.ini file & parse it:
96 profiles_ini = os.path.join(config_dir,'profiles.ini') 92 profiles_ini = os.path.join(config_dir,'profiles.ini')
97 if os.path.exists(profiles_ini):93 if os.path.exists(profiles_ini):
@@ -109,17 +105,25 @@
109 profiles_d[profile_parser.get(section, 'Name')] = (os.path.join(config_dir, profile_parser.get(section, 'Path')), is_default)105 profiles_d[profile_parser.get(section, 'Name')] = (os.path.join(config_dir, profile_parser.get(section, 'Path')), is_default)
110 106
111 # summarize the extensions loaded on each profile (either global and local):107 # summarize the extensions loaded on each profile (either global and local):
108 # also append the pluginreg.dat file of the default profile (maybe in a
109 # future append each profile's pluginreg.dat file)
112 extensions_dict, themes_dict, extension_summary = {}, {}, ''110 extensions_dict, themes_dict, extension_summary = {}, {}, ''
113 for profile_name in profiles_d.keys():111 for profile_name in profiles_d.keys():
114 profile_path, is_default = profiles_d[profile_name]112 profile_path, is_default = profiles_d[profile_name]
115 extensions_ini = os.path.join(profile_path, 'extensions.ini')113 extensions_ini = os.path.join(profile_path, 'extensions.ini')
114 pluginreg_dat = os.path.join(profile_path, 'pluginreg.dat')
115 if os.path.exists(pluginreg_dat):
116 if is_default == '1':
117 report['default_profile_pluginreg.dat'] = open(pluginreg_dat).read()
118 else:
119 report['profile_%s_pluginreg.dat' % profile_name] = open(pluginreg_dat).read()
116 if os.path.exists(extensions_ini):120 if os.path.exists(extensions_ini):
117 # attach each profile's extensions.ini too (not enabled).121 # attach each profile's extensions.ini too (not enabled).
118 #report['extensions.ini (profile: %s)' % profile_name ] = open(extensions_ini).read()122 #report['extensions.ini (profile: %s)' % profile_name ] = open(extensions_ini).read()
119 (extensions_dict['gre_extensions'], extensions_dict['app_extensions'], extensions_dict['local_extensions']),\123 (extensions_dict['gre_extensions'], extensions_dict['app_extensions'], extensions_dict['local_extensions']), \
120 (themes_dict['gre_theme'], themes_dict['app_theme'], themes_dict['local_theme']) = extensions_ini_parser(extensions_ini)124 (themes_dict['gre_theme'], themes_dict['app_theme'], themes_dict['local_theme']) = extensions_ini_parser(extensions_ini)
121 125 if is_default == '1':
122 if is_default == '1': is_default_str = ''' (The Default):'''126 is_default_str = ''' (The Default):'''
123 else: is_default_str = ''':'''127 else: is_default_str = ''':'''
124 extension_summary += '''Profile "%s"%s\n\n''' % (profile_name, is_default_str)128 extension_summary += '''Profile "%s"%s\n\n''' % (profile_name, is_default_str)
125 extension_summary += extension_summary_helper(extensions_dict['gre_extensions'], 'GRE Extensions')129 extension_summary += extension_summary_helper(extensions_dict['gre_extensions'], 'GRE Extensions')
@@ -128,10 +132,10 @@
128 extension_summary += extension_summary_helper(themes_dict['gre_theme'], 'GRE Theme', 0)132 extension_summary += extension_summary_helper(themes_dict['gre_theme'], 'GRE Theme', 0)
129 extension_summary += extension_summary_helper(themes_dict['app_theme'], 'Application Theme', 0)133 extension_summary += extension_summary_helper(themes_dict['app_theme'], 'Application Theme', 0)
130 extension_summary += extension_summary_helper(themes_dict['local_theme'], 'Local Theme', 0)134 extension_summary += extension_summary_helper(themes_dict['local_theme'], 'Local Theme', 0)
131 buffer = cStringIO.StringIO() # it's needed for propper apport attachments135 wbuffer = cStringIO.StringIO() # it's needed for propper apport attachments
132 print >> buffer, extension_summary136 print >> wbuffer, extension_summary
133 buffer.seek(0)137 wbuffer.seek(0)
134 report['ExtensionSummary'] = buffer.read()138 report['ExtensionSummary'] = wbuffer.read()
135 # debug (comment on production)139 # debug (comment on production)
136 # return report140 # return report
137141
@@ -139,5 +143,6 @@
139# (uncomment the 'return report' at add_report())143# (uncomment the 'return report' at add_report())
140if __name__ == "__main__":144if __name__ == "__main__":
141 D = {} 145 D = {}
142 report = add_info(D)146 REPORT = add_info(D)
143 for key in report.keys(): print '''%s:\n''' % key, report[key]147 for KEY in REPORT.keys():
148 print '''-------------------%s: ------------------\n''' % KEY, REPORT[KEY]
144149
=== modified file 'debian/changelog'
--- debian/changelog 2009-04-14 17:09:29 +0000
+++ debian/changelog 2009-04-14 22:36:52 +0000
@@ -1,5 +1,17 @@
1firefox-3.0 (3.0.8+nobinonly-0ubuntu4) UNRELEASED; urgency=low1firefox-3.0 (3.0.8+nobinonly-0ubuntu4) UNRELEASED; urgency=low
22
3 * debian/apport/firefox-3.0.py - removed unused code and minor refactoring.
4
5 -- H. Montoliu <hmontoliu@ubuntu.com> Tue Apr 14 22:36:03 UTC 2009
6
7firefox-3.0 (3.0.8+nobinonly-0ubuntu4) UNRELEASED; urgency=low
8
9 * fix LP: #361052 - firefox apport hook fails to retrieve pluginreg.dat file
10
11 -- H. Montoliu <hmontoliu@ubuntu.com> Tue Apr 14 21:50:44 UTC 2009
12
13firefox-3.0 (3.0.8+nobinonly-0ubuntu4) UNRELEASED; urgency=low
14
3 * fix LP: #359382 - "Ubuntu Wiki" default bookmark does not point to15 * fix LP: #359382 - "Ubuntu Wiki" default bookmark does not point to
4 the wiki home page; we use http://wiki.ubuntu.com now16 the wiki home page; we use http://wiki.ubuntu.com now
5 - update debian/patches/ubuntu_bookmarks.html17 - update debian/patches/ubuntu_bookmarks.html

Subscribers

People subscribed via source and target branches

to status/vote changes: