fnp
/
librarian.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2887829
)
dirty workaround for python unicode problems
author
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 7 Jul 2011 12:02:35 +0000
(14:02 +0200)
committer
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 7 Jul 2011 12:02:35 +0000
(14:02 +0200)
librarian/__init__.py
patch
|
blob
|
history
scripts/book2epub
patch
|
blob
|
history
scripts/book2html
patch
|
blob
|
history
scripts/book2pdf
patch
|
blob
|
history
scripts/book2txt
patch
|
blob
|
history
diff --git
a/librarian/__init__.py
b/librarian/__init__.py
index
5c4a355
..
5b6981d
100644
(file)
--- a/
librarian/__init__.py
+++ b/
librarian/__init__.py
@@
-6,7
+6,13
@@
import os
class ParseError(Exception):
import os
class ParseError(Exception):
- pass
+ def __str__(self):
+ """ Dirty workaround for Python Unicode handling problems. """
+ return self.message.message
+
+ def __unicode__(self):
+ """ Dirty workaround for Python Unicode handling problems. """
+ return self.message.message
class ValidationError(Exception):
pass
class ValidationError(Exception):
pass
diff --git
a/scripts/book2epub
b/scripts/book2epub
index
502d965
..
9adf4b4
100755
(executable)
--- a/
scripts/book2epub
+++ b/
scripts/book2epub
@@
-53,5
+53,5
@@
if __name__ == '__main__':
print '%(file)s:%(name)s:%(message)s' % {
'file': main_input,
'name': e.__class__.__name__,
print '%(file)s:%(name)s:%(message)s' % {
'file': main_input,
'name': e.__class__.__name__,
- 'message': e
.message
+ 'message': e
}
}
diff --git
a/scripts/book2html
b/scripts/book2html
index
f42c0ff
..
d61b299
100755
(executable)
--- a/
scripts/book2html
+++ b/
scripts/book2html
@@
-40,7
+40,7
@@
if __name__ == '__main__':
print '%(file)s:%(name)s:%(message)s' % {
'file': input_filename,
'name': e.__class__.__name__,
print '%(file)s:%(name)s:%(message)s' % {
'file': input_filename,
'name': e.__class__.__name__,
- 'message': e
.message
+ 'message': e
,
}
except IOError, e:
print '%(file)s:%(name)s:%(message)s' % {
}
except IOError, e:
print '%(file)s:%(name)s:%(message)s' % {
@@
-52,7
+52,7
@@
if __name__ == '__main__':
print '%(file)s:%(etype)s:%(message)s' % {
'file': input_filename,
'etype': e.__class__.__name__,
print '%(file)s:%(etype)s:%(message)s' % {
'file': input_filename,
'etype': e.__class__.__name__,
- 'message': e
.message
,
+ 'message': e,
}
raise
}
raise
diff --git
a/scripts/book2pdf
b/scripts/book2pdf
index
532577c
..
d10f400
100755
(executable)
--- a/
scripts/book2pdf
+++ b/
scripts/book2pdf
@@
-62,5
+62,5
@@
if __name__ == '__main__':
print '%(file)s:%(name)s:%(message)s; use -v to see more output' % {
'file': main_input,
'name': e.__class__.__name__,
print '%(file)s:%(name)s:%(message)s; use -v to see more output' % {
'file': main_input,
'name': e.__class__.__name__,
- 'message': e
.message
+ 'message': e
}
}
diff --git
a/scripts/book2txt
b/scripts/book2txt
index
f77e512
..
d56d6ff
100755
(executable)
--- a/
scripts/book2txt
+++ b/
scripts/book2txt
@@
-45,7
+45,7
@@
if __name__ == '__main__':
print '%(file)s:%(name)s:%(message)s' % {
'file': input_filename,
'name': e.__class__.__name__,
print '%(file)s:%(name)s:%(message)s' % {
'file': input_filename,
'name': e.__class__.__name__,
- 'message': e
.message
+ 'message': e
}
except IOError, e:
print '%(file)s:%(name)s:%(message)s' % {
}
except IOError, e:
print '%(file)s:%(name)s:%(message)s' % {
@@
-57,6
+57,6
@@
if __name__ == '__main__':
print '%(file)s:%(etype)s:%(message)s' % {
'file': input_filename,
'etype': e.__class__.__name__,
print '%(file)s:%(etype)s:%(message)s' % {
'file': input_filename,
'etype': e.__class__.__name__,
- 'message': e
.message
,
+ 'message': e,
}
raise
}
raise