Beispiel #1
0
def check_recode():
    try:
        import _recode

    except SystemError:
        raise RuntimeError("the recode library is probably broken.")

    # First, check if the recode version has the famous 3.6 bug
    rq = _recode.request("latin1..latex")

    if _recode.recode(rq, "abc") != "abc":
        raise RuntimeError("the _recode module is broken.")

    return 0
Beispiel #2
0
def check_recode():
    try:
        import _recode

    except SystemError:
        raise RuntimeError('the recode library is probably broken.')

    # First, check if the recode version has the famous 3.6 bug
    rq = _recode.request('latin1..latex')

    if _recode.recode(rq, 'abc') != 'abc':
        raise RuntimeError('the _recode module is broken.')

    return 0
Beispiel #3
0
    traceback.print_exception (etype, value, tb)

    error ('unexpected error')
else:
    if gtk.pygtk_version < (2,4,0):
        error ('requested version for PyGtk is %s, but I detected %s' % ('2.4.0', v))

try:
    import _recode
    import _bibtex
    import Pyblio

    rq = _recode.request('latin1..latex')

    l = 'abcd'
    c = _recode.recode(rq, l)

    if l != c:
        error('broken recode version')
except ImportError, msg:
    error('error in python modules dependencies: %s' % msg)

try:
    _bibtex.next_unfiltered
except AttributeError, msg:
    error('Error in python-bibtex module: required function »next_unfiltered« missing: %s'
	   % msg)
except:
    etype, value, tb = sys.exc_info ()
    traceback.print_exception (etype, value, tb)
    error('unexpected error')
Beispiel #4
0
 def __call__ (self, text):
     if text is None: return None
     
     return _recode.recode (self.request, text)