GithubHelp home page GithubHelp logo

zotero-sync's People

Contributors

jacobaclarke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

philrasch xzhlyx

zotero-sync's Issues

Updates for newer versions of packages

Hi Jacob,

I just tried to use zotero-sync on a 2021 Mac Pro (M1), and encountered some problems. I found some fixes that appear to make it work well, but I am not an advanced python user/developer, and have limited ability to check on various OS, etc. so I am a little reluctant to fork the repo, and issue pull requests, etc. Instead I am just going to report my findings to you in the hopes that it might be useful to you. Apologies if this is just wasting your bandwidth. Anyway, Here goes:

First, my environment, and the problem:

  1. I tried to use it on my mac pro (M1 Max, running Ventura 13.0.1)
  2. this required installing pip. I did so by installing conda (using the x86_64 architecture, not the ARM_64 architeture), then creating a new environment and install pip (telling conda to use the conda-forge channel, which produced an environment using python 3.11)
  3. pip install zotero_sync worked fine.
  4. executing zotero_sync trash scanned my zotfile directory on my machine and the cloud and decided that all of my PDF files should be moved to trash (which is not correct). So I started debugging.
  5. I was not able to build the app using the poetry lockfile (after installing poetry), so I gave up on that, and just debugged the code by executing python -m zotero_sync trash, then isolating code segments to help debug it. Here is what I learned.
  6. first, the variable "file_dir" that is returned from click is returned on my system as a string type variable, not a "Path" type. The result is that the glob command fails, and a later python command to create the string used to "mkdir trash" fails because the concatenation operator for a string differs from the concatenation for a path variables.
  7. it was easy to fix this by checking the type, and casting the string to a path (see my mods below).
  8. next problem was that the python code returns the list of PDF files on the cloud (variable "cloud_paths") with a string "attachment:" prepended to each filename, and so the compare with the list of files in the zotfile directory fails. So I added code to strip out the extra string and return only the filename (no path information) using the re package
  9. last problem was that the compare to identify the files not present on the cloud (so they should be deleted on the computer) uses "path.absolute", but I think what is needed is "path.name" to create the list in variable "computer_unique" that is need for the subsequent move to the trash file.

After making these changes the code works fine. It identifies the files that aren't specified on the cloud and moves them to trash if I let it.

I will attach a git diff against your repo in the hope that it might be useful to you, and I would be glad to issue a pull request if you prefer, or to test a new build, if you decide to upgrade the code with your preferred fixes.

Like I said, I hope this is useful to you or others trying the code. The script is definitely useful to me, and I learned more python at the same time. Thanks!

Phil

git_diff_out.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.