- commit
- e5f10177def30f386aaf08af53f089c052a82700
- parent
- eaef583b196682fc1b792750ecf86f68ee80e7b8
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2015-04-12 20:30
py3 compatibility
Diffstat
| M | cctool.py | 11 | +++++++---- |
1 files changed, 7 insertions, 4 deletions
diff --git a/cctool.py b/cctool.py
@@ -42,7 +42,6 @@ import sys 42 42 import argparse 43 43 import logging as log 44 44 from collections import OrderedDict45 -1 from ConfigParser import RawConfigParser as ConfigParser46 45 import json 47 46 from datetime import datetime 48 47 @@ -52,6 +51,11 @@ except ImportError: 52 51 from io import StringIO 53 52 54 53 try: -1 54 from ConfigParser import RawConfigParser as ConfigParser -1 55 except ImportError: -1 56 from configparser import RawConfigParser as ConfigParser -1 57 -1 58 try: 55 59 import ldif 56 60 except ImportError as err: 57 61 ldif = err @@ -156,7 +160,7 @@ def merged(data, key): 156 160 tmp[tmp_key] = entry 157 161 else: 158 162 missing.append(entry)159 -1 return tmp.values() + missing-1 163 return list(tmp.values()) + missing 160 164 161 165 162 166 class Format(object): @@ -257,7 +261,7 @@ class ABook(Format): 257 261 cp = ConfigParser() 258 262 i = 0 259 263 for item in data:260 -1 section = unicode(i)-1 264 section = str(i) 261 265 cp.add_section(section) 262 266 for key in item: 263 267 if key == 'bday': @@ -417,7 +421,6 @@ def main(): 417 421 informats, outformats = formats() 418 422 args = parse_args() 419 423420 -1 reload(sys)421 424 sys.setdefaultencoding('utf-8') 422 425 423 426 outformat = get_outformat(args)