diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-12-03 22:11:54 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-12-03 22:11:54 +0100 |
commit | 6603b300418efe0f28390a5b53208c9c7068489b (patch) | |
tree | 7d5b9f8c74a86695cce0b615f70d7b64073503d9 /mediagoblin/tools/text.py | |
parent | 71c6c432a5fe8fe0f96dac284562a8e1b981d669 (diff) | |
parent | d5bb51f9d4871d8b758875fb18be5d8a9fbdb260 (diff) | |
download | mediagoblin-6603b300418efe0f28390a5b53208c9c7068489b.tar.lz mediagoblin-6603b300418efe0f28390a5b53208c9c7068489b.tar.xz mediagoblin-6603b300418efe0f28390a5b53208c9c7068489b.zip |
Merge remote branch 'remotes/manolinux/671_spaces_in_tag_list_edit'
* remotes/manolinux/671_spaces_in_tag_list_edit:
* Feature #678: Drop custom delimiters in tags * Eliminate the definition of the tag delimiter for tests. * Remove a test that was related to custom tags delimiter. * Bug #671: Tags list on Edit page is not seperated by spaces and hard to read * Modify a test to include this space.
* Bug #671: Tags list on Edit page is not seperated by spaces and hard to read : Make 'media_tags_as_string' function put a space after each comma. * Feature #678: Drop custom delimiters in tags : I declare a constant in the begining of text.py file.
Diffstat (limited to 'mediagoblin/tools/text.py')
-rw-r--r-- | mediagoblin/tools/text.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mediagoblin/tools/text.py b/mediagoblin/tools/text.py index be1adb00..d576224d 100644 --- a/mediagoblin/tools/text.py +++ b/mediagoblin/tools/text.py @@ -43,6 +43,7 @@ HTML_CLEANER = Cleaner( host_whitelist=(), whitelist_tags=set([])) +TAGS_DELIMITER=','; def clean_html(html): # clean_html barfs on an empty string @@ -67,7 +68,7 @@ def convert_to_tag_list_of_dicts(tag_string): # Split the tag string into a list of tags for tag in stripped_tag_string.split( - mg_globals.app_config['tags_delimiter']): + TAGS_DELIMITER): # Ignore empty or duplicate tags if tag.strip() and tag.strip() not in [t['name'] for t in taglist]: @@ -85,7 +86,7 @@ def media_tags_as_string(media_entry_tags): """ media_tag_string = '' if media_entry_tags: - media_tag_string = mg_globals.app_config['tags_delimiter'].join( + media_tag_string = (TAGS_DELIMITER+u' ').join( [tag['name'] for tag in media_entry_tags]) return media_tag_string |