File: android-deltas-sync/

PC setup code => EDIT ME ON YOUR PC.

Change the assigned values following "# SETTINGS" below.  The 
settings you make here are shared by initial copies and syncs.
They're also used by verifies and exports, with reversed roles.

See _README.html for license, attribution, version, and docs.


How to edit settings:

You need to edit this file on the PC copy of this package only.

This is Python code: spaces work around '=', quote all strings with
either ' or ", and use r'...', '..\\..', or '../..' for Windows-path
backslashes.  In all paths, home-folder (~) and environment-variable 
($var) syntax is automatically expanded on all platforms.

For LOGS, give the path to any folder on your PC for logfile saves.
On Unix, logs may be monitored with 'tail -f LOGS/logfilename'.

For MALL, give the path to the folder where you've unzipped the
Mergeall source-code package on your PC.  Any folder will do, but
~/Downloads/Mergeall-source is normal on both Unix and Windows.

For FROM,  give the path to the content folder on your PC.
For TO,    give the path to the content folder on your proxy drive.
For STUFF, give the name of your content's top-level folder.

Content folders ($ means value of):
   - $FROM/$STUFF   is your content copy's folder on your PC
   - $TO/$STUFF     is your content copy's folder on your proxy drive

Zipfiles - if TR is the root of the proxy drive that hosts TO:
   - $TR/$ is the $FROM/$STUFF  zip made for initial copies
   - $TR/ is the PC-changes    zip made for content syncs
   - $TR/  is the phone-content zip used for verify/export

Temp folders:
   - $FROM/DELTAS   is the temp folder where syncs create deltas
   - $FROM/PHONE    is the temp folder where verify/export unzip

Temp zipfiles:
   - $FROM/$ made by initial copies, moved to $TR/$
   - $FROM/ made by syncs, moved to $TR/ 

Temp items are automatically removed; verify/export offer retention.



- FROM can be any folder on your PC.  It's $STUFF root folder and 
  all subfolders below it are your copied and synced "content." 

- Initial copies and syncs transfer content from the FROM source; 
  verify and export scripts treat FROM as a destination instead.

- TO can be any folder on the proxy drive.  Initial copies and syncs
  use TO's drive-root prefix to store a zipfile to be copied to the 
  phone.  The verify and export scripts assume a at the 
  root of TO, unzip it to a temp folder named PHONE in $FROM on the 
  PC, and apply it to $FROM/$STUFF.

- FROM and TO will always be disjoint on the PC, because FROM 
  must be a different, removable drive to attach to the phone.

- In this system, "PC" means a Windows, macOS, or Linux device, 
  but "phone" can be anything: though designed to sync changes 
  to Android 11 and later, these scripts can also sync to both
  earlier Androids and PCs.  Use your PC's path syntax here.



[1.2] BackupChanges here applies to both the proxy for normal syncs, 
      and the PC and proxy for export-script backsyncs.

[1.2] TO is now preset to the macOS root of a 1TB Samsung T7 SSD, 
      pressed into service as proxy in Sep-2022.  Your TOs may vary.



# Folders: quoted paths

LOGS  = '~/Desktop/deltas-logs'       # logfiles folder (tail -f to watch)
MALL  = '~/MY-STUFF/Code/mergeall'    # Mergeall source-code folder

FROM  = '~'                           # path to STUFF content root on PC
TO    = '/Volumes/T7_B'               # path to STUFF content root on proxy
STUFF = 'MY-STUFF'                    # name of content's root folder on both

# Options: True or False

PauseSteps      = True     # stop for enter or ctrl-c between steps?
VerifyProxy     = True     # verify proxy copy with mergeall/diffall?
PreviewSyncs    = True     # show differences and ask before saving deltas?
CheckFilenames  = True     # ask to run nonportable-filenames fixer in init+syncs?
ShowRuntimes    = True     # display each step's runtime in the console?  
ForceKeyToClose = False    # require enter/return to close script (auto on Windows)?
BackupChanges   = True     # save proxy/PC items changed so sync can be rolled back?

[Home page] Books Code Blog Python Author Train Find ©M.Lutz