Open jfburkhart opened 10 years ago
Hi, that sounds like a good approach and would be a lot less annoying than having to use the synchronisation script. Are you planning on synchronising the database file with Dropbox too and then copying it to where Mendeley expects it to be? I think you could use MendeleyDB.document_files
to find all the documents with a localUrl that need updating and then use MendeleyDB.update_file
to update the url with a new base path. You'll have to reorganise how the base_url attribute is used though so that in MendeleyDB.get_file_name
it would know how to strip off the original base path from the file url. That might be a bit tricky.
I forked your version, and have created something the 'delicately' works, but it is far from robust. Have a look, I've used now your classes from the mendeleyfilesync.MendeleyDB
module class, but I had to add a few methods and make one change, and I don't know what impact that would have elsewhere:
https://github.com/jfburkhart/Mendeley-FileSync/commit/b615227ab931f53b62d44cbd5a6403ece98bc7d0
See this commit and the messages at the bottom regarding your setting of:
path = os.path.abspath(path)
What I have set up now is that my Organizer Library is stored on Dropbox, both systems see it. My config directory for Mendeley is also stored in the cloud (Copy actually) and I've created symlinks on both the linux system and on the windows side (I forget what symlinks are called in window, but the point is that %LOCALAPPDATA%//Mendeley Ltd/Mendeley Desktop/
actually points to my Copy cloud storage.
In Windows I don't modify anything, but on linux when I start up, I modify the database and switch the monitor.sql database, then when the program closes, I revert everything.
Note that in Linux, I've actually replaced /usr/bin/mendeleydesktop to point to my python script and have a binary called mendeleydesktop.bin that the python script calls.
I wouldn't call it elegant or robust, but it seems to be working! ;)
Ok cool, I'm not sure why you would have needed to remove the path = os.path.abspath(path)
line, that converts a relative path to an absolute path and shouldn't have any effect if the path is already absolute. It isn't obvious how that could have affected your code unless the way Mendeley stores the OrganiserLocation path is a bit weird.
Hey Adam, it's now been 2 years since the last discussion about your script and I was wondering if you still use it yourself - or if you have found a better solution / a better software? Mendeley's feature integration seems to be REALLY cumbersome, especially for features that have a high voting on feedback.mendeley.com (The relative paths issue is at 8th place!).
Let me know!
(Btw: I ported your script to python3 in the meantime - was not much to do :-))
Hi, no I don't use this script myself any more, and I don't use Mendeley or any other reference management software because I'm not working in academia. I'm not aware of anything better, and it's a bit disappointing to see this is still an issue in Mendeley. I'll keep accepting bug fixes here if people are still finding this script useful but won't be planning on making any changes to the script myself.
Ok, thanks Adam for letting me know. I'll continue to use Mendeley in combination with your script. I'm convinced that it's still the best way to go for now. Cheers
Not really an issue, but rather working on a different approach. Maybe you could help make this more robust / generic.
I'm trying to create a python script that opens the database before and after launching mendeley and modifies it to fit whichever system your are running. I have it working now that it will change the Organiser/OrganiserLocation, but now I need to deal with the Files table and the localUrl problems... and it would certainly make sense to use what you've created.
Here's what I have so far: