|
|
|
|
|
|
|
|
path_to_unicode(path)
Convert a filesystem path to unicode, using the filesystem encoding. |
source code
|
|
|
|
stripws(text,
leading=True,
trailing=True)
Strips unicode white-spaces and ZWSPs from text. |
source code
|
|
|
|
strip_line_ws(text,
leading=True,
trailing=True)
Strips unicode white-spaces and ZWSPs from each line of text. |
source code
|
|
|
|
javascript_quote(text)
Quote strings for inclusion in single or double quote delimited
Javascript strings |
source code
|
|
|
|
to_js_string(text)
Embed the given string in a double quote delimited Javascript string
(conform to the JSON spec) |
source code
|
|
|
|
|
|
|
|
unicode
|
|
|
|
|
|
|
quote_query_string(text)
Quote strings for query string |
source code
|
|
|
|
|
|
|
stream_encoding(stream)
Return the appropriate encoding for the given stream. |
source code
|
|
|
|
console_print(out,
*args,
**kwargs)
Output the given arguments to the console, encoding the output
as appropriate. |
source code
|
|
|
|
|
|
|
|
|
|
raw_input(prompt)
Input one line from the console and converts it to unicode as
appropriate. |
source code
|
|
|
|
|
|
|
|
|
|
print_table(data,
headers=None,
sep=' ',
out=None,
ambiwidth=None)
Print data according to a tabular layout. |
source code
|
|
|
|
|
|
|
wrap(t,
cols=75,
initial_indent='',
subsequent_indent='',
linesep='\n',
ambiwidth=1)
Wraps the single paragraph in t, which contains unicode characters. |
source code
|
|
|
|
obfuscate_email_address(address)
Replace anything looking like an e-mail address ('@something')
with a trailing ellipsis ('@…') |
source code
|
|
|
|
|
|
|
breakable_path(path)
Make a path breakable after path separators, and conversely, avoid
breaking at spaces. |
source code
|
|
|
|
normalize_whitespace(text,
to_space=u' ',
remove=u'')
Normalize whitespace in a string, by replacing special spaces by normal
spaces and removing zero-width spaces. |
source code
|
|
|
|
|
|
|
cleandoc(message)
Removes uniform indentation and leading/trailing whitespace. |
source code
|
|
|
|
|
|
|
|
|
|
fix_eol(text,
eol)
Fix end-of-lines in a text. |
source code
|
|
|
|
|
|
|
unicode_from_base64(text)
Safe conversion of text to unicode based on utf-8 bytes. |
source code
|
|
|
|
levenshtein_distance(lhs,
rhs)
Return the Levenshtein distance between two strings. |
source code
|
|
|
|
sub_vars(text,
args)
Substitute $XYZ-style variables in a string with provided values. |
source code
|
|