allow remarkable-fs toconvert to local folders #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the beginning this pull request was created. This may make a lot of people very angry and may be widely regarded as a bad move.
Somewhat seriously though, here is a pull request that, in a hopefully backwards-compatible way, creates an alternative backend where remarkable files are essentially just read and written in another folder, rather than to the ssh server. This creates a few interesting usecases:
The part of this pull request that may make people angry is the way in which it was achieved. Since I figured this would make a useful upstream contribution, there are some lines in
__init__
of my alternateDocumentRootDir
class (better names welcome). This ugly hack basically is some nestednamedtuple
's that essentially emulate the structure of the sftp object being passed around, replacing its methods likeopen()
,stat()
, .etc with their equivalents for opening regular files, such as python's standardopen
and various calls toos
such asos.stat
.This mainly arose out of some errors I was having with the ssh implementation in this package due to my specific setup not playing super nice with the ssh library used here, so hopefully this also helps other people looking to get something to work on their system.
The one word of warning i have is that I noticed that the ssh connection code in this program intentionally disables, then re-enables
xochitl
while it is working, which this additional mode does not do, so while your remarkable may not freeze while copying files, that may mean your device is more likely to be bricked (i presume).Also, I would be happy to update the naming/docs on my fork to turn this into a separate project if it doesn't fit the goal of this project, just figured id make a pull request to give the option.