summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSushrut Rathi <sushrutrathi@Sushruts-MacBook-Pro.local>2016-05-03 13:47:25 +0530
committerSushrut Rathi <sushrutrathi@Sushruts-MacBook-Pro.local>2016-05-03 13:47:25 +0530
commit71ca275dd1cea753a663cbe720239de1a7abb08f (patch)
treedca1af4b72f6c855313688bd6bc167ad2fd12669
parent75bbfbbaf467d220630df44b1f87454785b35b70 (diff)
downloadtablib-71ca275dd1cea753a663cbe720239de1a7abb08f.tar.gz
changes in code refactoring
-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 )