From 915f3186073f5195a0d976fbc4cf003754ad7eb7 Mon Sep 17 00:00:00 2001 From: Garrett Berg Date: Wed, 6 Nov 2013 11:55:43 -0800 Subject: [PATCH] commiting, tagging test, pushing --- extra/richtext.py | 24 ++++++++++++------------ publish.py | 10 ++++++++-- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/extra/richtext.py b/extra/richtext.py index b144d25..452713e 100644 --- a/extra/richtext.py +++ b/extra/richtext.py @@ -152,7 +152,7 @@ def get_position(html_list, true_position = None, html_position = None, cur_html_pos += len(textrp.html_text) cur_true_pos += len(textrp.true_text) cur_vis_pos += len(textrp.visible_text) - if true_position != None and cur_true_pos> true_position: + if true_position != None and cur_true_pos > true_position: break elif html_position != None and cur_html_pos > html_position: break @@ -160,9 +160,10 @@ def get_position(html_list, true_position = None, html_position = None, break prev_hpos, prev_tpos, prev_vpos = (cur_html_pos, cur_true_pos, cur_vis_pos) + else: + raise ValueError("Position is outside of text length " + + str((true_position, html_position, visible_position))) - # going to take a bit more work -- for visual I need to ALSO figure out - # if it is inside of a visual section!!! if true_position != None: out_true_pos = true_position relative_pos = true_position - prev_tpos @@ -512,17 +513,16 @@ def html_process_paragraph(bs_paragraph, keepif, keep_plain): front, back = fback; del fback style = bs_paragraph.attrs['style'] style_attrs = get_style_attributes(style) - no_newline = False - try: - # Apparently there is such a thing as an "empty paragraph" that - # doesn't trigger a line ending! What an annoying "feature" - if style_attrs['-qt-paragraph-type'] == 'empty': - no_newline = True - except KeyError: - pass + no_newline = False +# try: +# # Apparently there is such a thing as an "empty paragraph" that +# # doesn't trigger a line ending! What an annoying "feature" +# if style_attrs['-qt-paragraph-type'] == 'empty': +# no_newline = True +# except KeyError: +# pass front = HtmlPart(front, '', '') - # -qt-paragraph-type:empty if no_newline: back = HtmlPart(back, '', '') diff --git a/publish.py b/publish.py index c026ab9..96789dd 100644 --- a/publish.py +++ b/publish.py @@ -28,6 +28,8 @@ # commiting a change from spyder PYTHON_VERSION = 2 +CLOUD_TB_VERSION = None + '''Add your file types to list below -- comma separated''' FILE_TYPES = '.c, .h, .cpp, .hpp, .txt, .py' @@ -72,8 +74,6 @@ import textools - - def update_license(path): '''updates the license information and the first line of the file for the file on the path''' @@ -124,6 +124,12 @@ def update_license(path): with open(path, 'w') as f: f.write(text) +def update_cloudtb(cloud_tb_version): + # see http://stackoverflow.com/questions/791959/how-to-use-git-to-download-a-particular-tag + git_archive = ('git archive --format=zip ' + '--remote=[{hostname}]:[{repo_path}][{tag_name}] ' + '> {out_file_path}') + ''' Publish