View Single Post
Old 01-26-2020, 07:50 PM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by khonshu View Post
Hello all.

Most of my books are in spanish and so I have titles with beginning exclamation and question marks (¿ and ¡). I would like to add that symbols to the list of articles to be ignored when sorting text but I'm getting an error.

The items I'm adding are:

u'¿\\s+'),
u'¡\\s+'),

The error is:

Code:
calibre, version 4.9.1

Traceback (most recent call last):
  File "site-packages\calibre\gui2\preferences\tweaks.py", line 535, in apply_tweak
  File "<string>", line 93
    u'¿\\s+'),
             ^
SyntaxError: invalid syntax
The arrow points the + symbol after the s.

Of course someone would think of removing such caracters from the title but we are talking about a few thousand books. Any help would be welcome. Thanks.
The problem is actually the right parenthesis. The error dialog uses a proportional font, and the characters in the line do not line up properly. I have wrapped the error in code tags to show this.

You should be using just:

Code:
 u'¿\\s+',
 u'¡\\s+',
The last comma is should be OK.
davidfor is offline   Reply With Quote