Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Debug always is written in debug mode #192

Merged
merged 1 commit into from

2 participants

@scopatz
Owner

Fixes #153. Last issue before v0.4

@scopatz scopatz added this to the v0.4 milestone
@scopatz
Owner

@girving or @jamescasbon, would you mind reviewing this? Thanks!

@jamescasbon
Collaborator

Looks good to me. Let's cut that release.

@scopatz
Owner

Sounds good! Would you mind merging this in, please? Thanks.

@scopatz scopatz merged commit dfea198 into from
@scopatz scopatz deleted the branch
@scopatz
Owner

Merged given @jamescasbon aproval

@jamescasbon
Collaborator

Sorry - I thought I had merged it - apologies for not seeing your note sooner.

@scopatz
Owner

Not a problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 19, 2014
  1. @scopatz
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 4 deletions.
  1. +1 −0  xdress/main.py
  2. +11 −4 xdress/plugins.py
View
1  xdress/main.py
@@ -221,6 +221,7 @@ def main():
plugins.setup()
plugins.execute()
plugins.teardown()
+ plugins.exit()
if __name__ == '__main__':
main()
View
15 xdress/plugins.py
@@ -271,6 +271,7 @@ class Plugins(object):
3. ``setup()``
4. ``execute()``
5. ``teardown()``
+ 6. ``exit()``
"""
@@ -387,8 +388,10 @@ def exit(self, err=0):
if rc.debug:
import traceback
sep = nyansep + '\n\n'
- msg = u'{0}xdress failed with the following error:\n\n'.format(sep)
- msg += traceback.format_exc()
+ msg = u''
+ if err != 0:
+ msg += u'{0}xdress failed with the following error:\n\n'.format(sep)
+ msg += traceback.format_exc()
if len(self.warnings) > 0:
warnmsg = u'\n{0}xdress issued the following warnings:\n\n{1}\n\n'
warnmsg = warnmsg.format(sep, "\n".join(self.warnings))
@@ -402,9 +405,13 @@ def exit(self, err=0):
msg += plugin_msg
with io.open(os.path.join(rc.builddir, 'debug.txt'), 'a+') as f:
f.write(msg)
- raise
+ if err != 0:
+ raise
else:
- sys.exit('ERROR: ' + str(err))
+ if err == 0:
+ sys.exit()
+ else:
+ sys.exit('ERROR: ' + str(err))
def summarize_rcdocs(modnames, headersep="=", maxdflt=2000):
"""For a list of plugin module names, return a rST string that
Something went wrong with that request. Please try again.