Fix #3583 (Calibre adds spaces when converting from RTF)

This commit is contained in:
Kovid Goyal 2009-10-19 16:58:12 -06:00
parent 5d2ed7d240
commit 3b0eca7efa
2 changed files with 4 additions and 3 deletions

View File

@ -72,7 +72,7 @@ class Tokenize:
return line
def __compile_expressions(self):
self.__ms_hex_exp = re.compile(r"\\\'(..)")
self.__utf_exp = re.compile(r"\\u(-?\d{3,6})")
self.__utf_exp = re.compile(r"\\u(-?\d{3,6}) {0,1}")
self.__splitexp = re.compile(r"(\\[\\{}]|{|}|\\[^\s\\{}&]+(?:\s)?)")
self.__par_exp = re.compile(r'\\$')
self.__mixed_exp = re.compile(r"(\\[a-zA-Z]+\d+)(\D+)")

View File

@ -1621,12 +1621,13 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
try:
os.makedirs(self.library_path)
except:
self.library_path = os.path.expanduser('~/Library')
self.library_path = os.path.expanduser('~/CalibreLibrary')
error_dialog(self, _('Invalid library location'),
_('Could not access %s. Using %s as the library.')%
(repr(self.library_path), repr(self.library_path))
).exec_()
os.makedirs(self.library_path)
if not os.path.exists(self.library_path):
os.makedirs(self.library_path)
def read_settings(self):