Hozzászólok Aktív témák

  • snowdog

    veterán

    Nekem nem sikerült. Nem fogadja el a kódot, valami baja van vele: "Exception while compiling function"

    "calibre, version 1.12.0
    ERROR: Template functions: Exception while compiling function

    Traceback (most recent call last):
    File "site-packages\calibre\gui2\preferences\template_functions.py", line 170, in create_button_clicked
    File "site-packages\calibre\utils\formatter_functions.py", line 1355, in compile_user_function
    File "<string>", line 5
    def evaluate(self, formatter, kwargs, mi, locals, val, is_read_pct, is_read_str, is_reading_str, no_page_read_str): try: test_val = int(is_read_pct) except: return 'is_read_pct is not a number' import re mg = re.match('.*\s(\d+[-/]\d+[-/]\d+).*?Last Page Read: Location \d+ \((\d+)%\)', val, re.I + re.DOTALL); if mg is None: return no_page_read_str date = mg.group(1) pct = mg.group(2) try: f = int(pct) if f > test_val: return is_read_str elif f > 0: return is_reading_str + ': ' + pct + '%' except: pass return no_page_read_str
    ^
    SyntaxError: invalid syntax
    ..."

Hozzászólok Aktív témák