Merge lp:~mvo/software-center/pep8-again into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3177
Proposed branch: lp:~mvo/software-center/pep8-again
Merge into: lp:software-center
Diff against target: 142 lines (+27/-24)
2 files modified
software-center (+23/-23)
tests/test_pep8.py (+4/-1)
To merge this branch: bzr merge lp:~mvo/software-center/pep8-again
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+124362@code.launchpad.net

Description of the change

I stumbled on non-pep8 software-center today, so I fixed that. So trivial
it does not really need review.

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'software-center'
2--- software-center 2012-09-06 10:19:43 +0000
3+++ software-center 2012-09-14 08:34:33 +0000
4@@ -49,42 +49,43 @@
5
6 if __name__ == "__main__":
7
8- parser = OptionParser("usage: %prog [options] [package-name | apturl | deb-file]",
9- version="%prog "+VERSION)
10+ parser = OptionParser("usage: %prog [options] [package-name | apturl | "
11+ "deb-file]", version="%prog " + VERSION)
12 parser.add_option("--debug", action="store_true",
13 help="enable debug mode", default=False)
14- parser.add_option("--debug-filter",
15+ parser.add_option("--debug-filter",
16 help="show only specific messages. supported currently: "
17 "'softwarecenter.performance'")
18 parser.add_option("--force-rtl", action="store_true",
19- help="force rtl mode (useful for debugging)",
20+ help="force rtl mode (useful for debugging)",
21 default=False)
22 parser.add_option("--display-navlog", action="store_true",
23- help="display a navigation history log (useful for debugging)",
24- default=False)
25+ help="display a navigation history log (useful for "
26+ "debugging)", default=False)
27 # FIXME: REMOVE THIS option once launchpad integration is enabled
28 # by default
29 parser.add_option("--enable-lp", action="store_true",
30- help="enable launchpad integration (for development use)",
31- default=False)
32+ help="enable launchpad integration (for development "
33+ "use)", default=False)
34 parser.add_option("--disable-buy", action="store_true",
35 help="disable support to buy software",
36 default=False)
37 parser.add_option("--disable-apt-xapian-index", action="store_true",
38- help="disable support for apt-xapian-index (technical items)",
39- default=False)
40+ help="disable support for apt-xapian-index (technical "
41+ "items)", default=False)
42 parser.add_option("--measure-startup-time", action="store_true",
43- help="open and wait until the window is visible, then close, only useful for profiling",
44- default=False)
45+ help="open and wait until the window is visible, "
46+ "then close, only useful for profiling", default=False)
47 parser.add_option("--dummy-backend", action="store_true",
48- help="run with a dummy backend, this will not actually install or remove anything and is useful for testing",
49+ help="run with a dummy backend, this will not actually "
50+ "install or remove anything and is useful for testing",
51 default=False)
52 parser.add_option("--packagekit-backend", action="store_true",
53- help="use PackageKit backend (experimental)",
54+ help="use PackageKit backend (experimental)",
55 default=False)
56 parser.add_option("--profile", action="store_true",
57 help="use cProfile to gather a profile dump for e.g. "
58- "kcachegrind, runsnake, gprof2dot",
59+ "kcachegrind, runsnake, gprof2dot",
60 default=False)
61
62 (options, args) = parser.parse_args()
63@@ -92,17 +93,17 @@
64 # statup time measure implies "performance" in debug filters
65 if options.measure_startup_time:
66 options.debug_filter = "performance,traceback"
67-
68+
69 if options.debug_filter:
70 softwarecenter.log.add_filters_from_string(options.debug_filter)
71 # implies general debug
72 options.debug = True
73-
74+
75 if options.debug:
76 softwarecenter.log.root.setLevel(level=logging.DEBUG)
77 else:
78 softwarecenter.log.root.setLevel(level=logging.INFO)
79-
80+
81 # packagekit
82 if options.packagekit_backend:
83 softwarecenter.enums.USE_PACKAGEKIT_BACKEND = True
84@@ -112,7 +113,7 @@
85 if options.dummy_backend:
86 import atexit
87 from softwarecenter.tests.utils import (
88- start_dummy_backend,
89+ start_dummy_backend,
90 stop_dummy_backend)
91 start_dummy_backend()
92 atexit.register(stop_dummy_backend)
93@@ -133,7 +134,7 @@
94 with ExecutionTime("create SoftwareCenterApp"):
95 app = SoftwareCenterAppGtk3(datadir, xapian_base_path, options, args)
96
97- # DEBUG/PROFILE mode
98+ # DEBUG/PROFILE mode
99 if options.measure_startup_time:
100 logger = logging.getLogger("softwarecenter.performance")
101 with ExecutionTime("show() & gtk events until visible"):
102@@ -161,7 +162,7 @@
103
104 time_to_ready = time.time() - time_entering_main
105 print(time_to_ready)
106- logger.debug("** main window fully ready after: %s seconds" %
107+ logger.debug("** main window fully ready after: %s seconds" %
108 time_to_ready)
109 sys.exit(0)
110
111@@ -170,7 +171,7 @@
112 # use something like "pyprof2calltree" from pypi and kcachegrind:
113 # $ python ./pyprof2calltree.py -i software-center_*.pyprof -k
114 # OR
115- # $ runsnakerun software_center_*.pyprof
116+ # $ runsnakerun software_center_*.pyprof
117 # OR
118 # gprof2dot (http://code.google.com/p/jrfonseca/wiki/Gprof2Dot):
119 # $ gprof2dot.py -f pstats software-center_20120620_114618.pyprof |\
120@@ -185,4 +186,3 @@
121 # run it normally
122 app.run(args)
123 Gtk.main()
124-
125
126=== modified file 'tests/test_pep8.py'
127--- tests/test_pep8.py 2012-08-15 10:00:27 +0000
128+++ tests/test_pep8.py 2012-09-14 08:34:33 +0000
129@@ -9,10 +9,13 @@
130
131 def test_all_code(self):
132 res = 0
133+ testdir = os.path.dirname(__file__)
134 res += subprocess.call(
135 ["pep8",
136 "--repeat",
137- os.path.dirname(softwarecenter.__file__)
138+ os.path.dirname(softwarecenter.__file__),
139+ # test the main binary too
140+ os.path.join(testdir, "..", "software-center"),
141 ])
142 self.assertEqual(res, 0)
143

Subscribers

People subscribed via source and target branches