App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Static Public Member Functions | Static Public Attributes | List of all members
google.appengine.tools.devappserver2.admin.memcache_viewer.StringValueConverter Class Reference
Inheritance diagram for google.appengine.tools.devappserver2.admin.memcache_viewer.StringValueConverter:

Static Public Member Functions

def to_display
 
def to_cache
 

Static Public Attributes

 memcache_type = memcache.TYPE_STR
 
string placeholder = 'hello world!'
 
 can_edit = True
 
string friendly_type_name = 'String'
 

Member Function Documentation

def google.appengine.tools.devappserver2.admin.memcache_viewer.StringValueConverter.to_cache (   display_value)
static
Convert a displayable representation to a memcache string.

Take a displayable/editable text string and convert into a memcache string.
As a memcache string is technically an array of bytes, we only allow
characters from the ASCII range and require all other bytes to be indicated
via string escape. (because if we see the Unicode character Yen sign
(U+00A5) we don't know if they want the byte 0xA5 or the UTF-8 two byte
sequence 0xC2 0xA5).

Args:
  display_value: a text (i.e. unicode string) using only ASCII characters;
non-ASCII characters must be represented string escapes.

Returns:
  An array of bytes.

Raises:
  UnicodeEncodeError: a non-ASCII character is part of the input.
def google.appengine.tools.devappserver2.admin.memcache_viewer.StringValueConverter.to_display (   cache_value)
static
Convert a memcache string into a displayable representation.

Make a memcache string into a text string that can be displayed or edited.
While called a string, it is technically just an array of bytes. Because
we do not know what encoding the bytes are (and possibly they are not an
encoded text string - for example they could be an MD5 hash) we display
in string-escaped form.

Args:
  cache_value: an array of bytes

Returns:
  A unicode string that represents the sequence of bytes and can be
  roundtripped back to the sequence of bytes.

The documentation for this class was generated from the following file: