diff options
| author | Tom Christie | 2011-12-29 13:31:12 +0000 |
|---|---|---|
| committer | Tom Christie | 2011-12-29 13:31:12 +0000 |
| commit | 07349597ab936dc9887caa70b5d7d2860c897b12 (patch) | |
| tree | db1fdb8934e4d8dc8d3afe8d1e9fd076e3a4e27d /djangorestframework/utils/__init__.py | |
| parent | 1bdc5eacc6290c486796eb5ab8fa29092137dab6 (diff) | |
| download | django-rest-framework-07349597ab936dc9887caa70b5d7d2860c897b12.tar.bz2 | |
whitespace fixes
Diffstat (limited to 'djangorestframework/utils/__init__.py')
| -rw-r--r-- | djangorestframework/utils/__init__.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/djangorestframework/utils/__init__.py b/djangorestframework/utils/__init__.py index 04baea78..305311f4 100644 --- a/djangorestframework/utils/__init__.py +++ b/djangorestframework/utils/__init__.py @@ -36,7 +36,7 @@ def as_tuple(obj): return obj return (obj,) - + def url_resolves(url): """ Return True if the given URL is mapped to a view in the urlconf, False otherwise. @@ -50,7 +50,7 @@ def url_resolves(url): # From http://www.koders.com/python/fidB6E125C586A6F49EAC38992CF3AFDAAE35651975.aspx?s=mdef:xml #class object_dict(dict): -# """object view of dict, you can +# """object view of dict, you can # >>> a = object_dict() # >>> a.fish = 'fish' # >>> a['fish'] @@ -103,8 +103,8 @@ class XML2Dict(object): old = node_tree[tag] if not isinstance(old, list): node_tree.pop(tag) - node_tree[tag] = [old] # multi times, so change old dict to a list - node_tree[tag].append(tree) # add the new one + node_tree[tag] = [old] # multi times, so change old dict to a list + node_tree[tag].append(tree) # add the new one return node_tree @@ -117,13 +117,13 @@ class XML2Dict(object): """ result = re.compile("\{(.*)\}(.*)").search(tag) if result: - value.namespace, tag = result.groups() + value.namespace, tag = result.groups() return (tag, value) def parse(self, file): """parse a xml file to a dict""" f = open(file, 'r') - return self.fromstring(f.read()) + return self.fromstring(f.read()) def fromstring(self, s): """parse a string""" @@ -159,7 +159,7 @@ class XMLRenderer(): xml.characters(smart_unicode(data)) def dict2xml(self, data): - stream = StringIO.StringIO() + stream = StringIO.StringIO() xml = SimplerXMLGenerator(stream, "utf-8") xml.startDocument() @@ -172,4 +172,4 @@ class XMLRenderer(): return stream.getvalue() def dict2xml(input): - return XMLRenderer().dict2xml(input)
\ No newline at end of file + return XMLRenderer().dict2xml(input) |
