summaryrefslogtreecommitdiff
path: root/tablib
diff options
context:
space:
mode:
authorKenneth Reitz <me@kennethreitz.org>2016-05-03 21:30:25 -0400
committerKenneth Reitz <me@kennethreitz.org>2016-05-03 21:30:25 -0400
commite16bb38c4894c51c15e84b115c13e086f9d3214a (patch)
treedca1af4b72f6c855313688bd6bc167ad2fd12669 /tablib
parent75bbfbbaf467d220630df44b1f87454785b35b70 (diff)
parent71ca275dd1cea753a663cbe720239de1a7abb08f (diff)
downloadtablib-e16bb38c4894c51c15e84b115c13e086f9d3214a.tar.gz
Merge pull request #238 from sushrutrathi/code_changes
changes in code refactoring
Diffstat (limited to 'tablib')
-rw-r--r--tablib/packages/markup.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tablib/packages/markup.py b/tablib/packages/markup.py
index 076a3d7..e52acae 100644
--- a/tablib/packages/markup.py
+++ b/tablib/packages/markup.py
@@ -71,10 +71,8 @@ class element:
for key, value in kwargs.iteritems( ):
if value is not None: # when value is None that means stuff like <... checked>
key = key.strip('_') # strip this so class_ will mean class, etc.
- if key == 'http_equiv': # special cases, maybe change _ to - overall?
- key = 'http-equiv'
- elif key == 'accept_charset':
- key = 'accept-charset'
+ if key in ['http_equiv', 'accept_charset']:
+ key.replace('_','-')
out = u"%s %s=\"%s\"" % ( out, key, escape( value ) )
else:
out = u"%s %s" % ( out, key )