Merge lp:~myint/restview/trunk into lp:~mgedmin/restview/trunk

Proposed by Steven Myint
Status: Merged
Merged at revision: 92
Proposed branch: lp:~myint/restview/trunk
Merge into: lp:~mgedmin/restview/trunk
Diff against target: 43 lines (+12/-0)
1 file modified
src/restview/restviewhttp.py (+12/-0)
To merge this branch: bzr merge lp:~myint/restview/trunk
Reviewer Review Type Date Requested Status
Marius Gedminas Approve
Review via email: mp+155099@code.launchpad.net

Description of the change

This adds a "--strict" option. I find this useful since I don't have to additionally use "rst2html" to check for syntax errors.

To post a comment you must log in.
Revision history for this message
Marius Gedminas (mgedmin) wrote :

Thanks, merged.

I find that Launchpad's UI, as well as Bazaar, get me down. I'll move restview to Github in the neear future.

review: Approve
Revision history for this message
Steven Myint (myint) wrote :

Great! On the rare occasion that I log in to Launchpad, I have to relearn how to use the interface.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/restview/restviewhttp.py'
2--- src/restview/restviewhttp.py 2012-12-22 14:20:31 +0000
3+++ src/restview/restviewhttp.py 2013-03-23 14:15:25 +0000
4@@ -305,6 +305,8 @@
5 css_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
6 'default.css')
7
8+ strict = None
9+
10 def __init__(self, root, command=None):
11 self.root = root
12 self.root_mtime = os.stat(root).st_mtime
13@@ -341,6 +343,10 @@
14 'embed_stylesheet': True}
15 else:
16 settings_overrides = {}
17+
18+ if self.strict:
19+ settings_overrides['halt_level'] = 1
20+
21 try:
22 docutils.core.publish_string(rest_input, writer=writer,
23 settings_overrides=settings_overrides)
24@@ -497,6 +503,9 @@
25 parser.add_option('--css',
26 help='use the specified stylesheet',
27 action='store', dest='css_path', default=None)
28+ parser.add_option('--strict',
29+ help='halt at the slightest problem',
30+ action='store_true', default=False)
31 opts, args = parser.parse_args(sys.argv[1:])
32 if not args and not opts.execute:
33 parser.error("at least one argument expected")
34@@ -518,6 +527,9 @@
35 else:
36 server.css_path = opts.css_path
37 server.css_url = None
38+
39+ server.strict = opts.strict
40+
41 if opts.listen:
42 try:
43 server.local_address = parse_address(opts.listen)

Subscribers

People subscribed via source and target branches