View Single Post
Old 06-09-2010, 03:47 AM   #47
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,495
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by timlegge View Post
The path separator issue affected most of the issues. If you see any issues, it would be helpful to know which OS and what the calibre display showed the path to be for the file.
Tim
Tim,

The path separator issue has bitten me more than once.

The 'rules' are:
- lpath must always be the path from the mount point, and must always be forward slashed. It must not have a leading slash.
- path must be the complete path, and must always use os.sep.
- prefix must be the path to the root of the storage, and must use os.sep. It must have a trailing os.sep.

If you carefully follow these rules, then all the various bits of software will know what to do when constructing and manipulating paths.

You might not have noticed a new classfunction added to USBMS.driver, normalize_paths. It takes a constructed path (for example, os.path.join(prefix, lpath)) and returns that path corrected for the local OS and validated to be unicode. The base driver uses that function liberally.
chaley is offline   Reply With Quote