Sync between devices, how to?
upwart last edited by
I have succesfully installed dhutchinson DropboxSync. Everything works perfectly, but ... only for .py files. I would like to sync sound and image files as well, particularly to download them from a Windows platform.
Is there a way to sync these files as well?
@upwart I know there is a better approach, but I did the following 3 line modifications:
Add this line top level, around line 20:
FILE_FILTER = ('.py','.pyui','.txt')
Replace line 122:
if file['is_dir'] == False and file['mime_type'].endswith('python'):
if file['is_dir'] == False and file['path'].endswith(FILE_FILTER):
Replace line 250:
if not file in processed_files and not os.path.isdir(file) and not file.startswith('.') and file.endswith('.py'):
if not file in processed_files and not os.path.isdir(file) and not file.startswith('.') and file.endswith(FILE_FILTER):
@ccc Thank you for opening an issue about nested folders, hope someone will pick it up soon.
ccc last edited by ccc
See @DavidHutchison response https://github.com/dhutchison/PythonistaScripts/issues/2 -- He is working on it.
Your proposed changes above would make a great pull request. I had not realized that str.endswith() can take a tuple... That is supercool.
I've pushed a new version with nested folder support & includes pyui files.
Additional extensions are easy to add now if someone wants to submit a PR with additions (there is a collection called SUPPORTED_EXTENSIONS near the start of the file).
Thanks for the interest in the script, it was only written as something to introduce me to Python and pythonista!
upwart last edited by
Thanks for this update. It's a great tool.
@Balur both bugs now resolved.
The feature request (for skip folders) is technically in the code (SKIP_FILES collection can be added to with paths relative to the root), but I'm leaving that issue open for now. I feel a configuration file will be a more maintainable approach going forward than having anyone using this having to keep track of their own code changes through updates.
@Balur yes whole folders work (I checked it when working on the fixes).
CarlRJ last edited by
I know Apple's restrictions prevent access to other syncing services from something that can run code (such as Pythonista), but does that also apply to a Pythonista-specific folder on Apple's own iCloud Drive?
ccc last edited by
Yes it does.