From 58687b3c8c37dc7812db569c4c1e15a5926bc7ca Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 13 Jun 2013 14:42:23 +0530 Subject: [PATCH 1/2] [utils] function that filters empty values, strips and joins values in a list --- webnotes/utils/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webnotes/utils/__init__.py b/webnotes/utils/__init__.py index 7c2911c71f..d5a07239ba 100644 --- a/webnotes/utils/__init__.py +++ b/webnotes/utils/__init__.py @@ -787,6 +787,10 @@ def comma_sep(some_list, sep): else: return some_list +def filter_strip_join(some_list, sep): + """given a list, filter None values, strip spaces and join""" + return (cstr(sep)).join((cstr(a).strip() for a in filter(None, some_list))) + def get_path(*path): import os return os.path.join(get_base_path(), *path) From 1256b07c5e301c4b2b8d868d29d3a9e104c4d7cd Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 13 Jun 2013 16:11:03 +0530 Subject: [PATCH 2/2] [progress bar] [fix] --- core/page/update_manager/update_manager.js | 2 +- public/js/wn/ui/messages.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/page/update_manager/update_manager.js b/core/page/update_manager/update_manager.js index 04debbf161..6081a7aeb0 100644 --- a/core/page/update_manager/update_manager.js +++ b/core/page/update_manager/update_manager.js @@ -46,7 +46,7 @@ wn.UpdateThisApp = Class.extend({ me.wrapper.update_output.toggle(false); me.wrapper.progress_bar.empty().toggle(true); this.wrapper.progress_bar.html('
\ -
\ +
\
\
' + wn._("Update is in progress. This may take some time.") + '
'); diff --git a/public/js/wn/ui/messages.js b/public/js/wn/ui/messages.js index f1e7b6fb66..4f9adf981c 100644 --- a/public/js/wn/ui/messages.js +++ b/public/js/wn/ui/messages.js @@ -5,7 +5,7 @@ wn.messages.waiting = function(parent, msg, bar_percent) { return $(repl('
\

%(msg)s

\
\ -
', { +
', { bar_percent: bar_percent, msg: msg }))