def tinymce_zip(options): """Create the zip file containing TinyMCE.""" tinymce_dir = path.path( options.app_folder) / 'soc/content/js/thirdparty/tiny_mce' tinymce_zip_filename = path.path(options.app_folder) / 'tiny_mce.zip' if tasks.environment.dry_run: tinymce_zip_fp = cStringIO.StringIO() else: # Ensure the parent directories exist. tinymce_zip_filename.dirname().makedirs_p() tinymce_zip_fp = open(tinymce_zip_filename, mode='w') try: write_zip_file(tinymce_zip_fp, tinymce_zip_files(tinymce_dir)) except Exception, exc: tinymce_zip_fp.close() tinymce_zip_filename.remove() raise tasks.BuildFailure('Error occurred creating tinymce.zip: %r' % (exc, ))
def run_pylint(): # Add app folder to path. sys.path.insert(0, options.app_folder.abspath()) # Add google_appengine directory to path. path = options.project_dir.abspath( ) / 'thirdparty' / 'google_appengine' sys.path.insert(0, path) # Specify PyLint RC file. path = options.project_dir.abspath() / 'pylintrc' arguments.append('--rcfile=' + path) # `lint.Run.__init__` runs the PyLint command. try: lint.Run(arguments) # PyLint will `sys.exit()` when it has finished, so we need to catch # the exception and process it accordingly. except SystemExit, exc: return_code = exc.args[0] if return_code != 0 and (not options.pylint.ignore): raise tasks.BuildFailure( 'PyLint finished with a non-zero exit code: %d' % return_code)
def t1(debug, error): debug("This is debug msg") error("This is error msg") raise tasks.BuildFailure("Yo, problem, yo")