2019-09-28 23:14:16 +01:00
2019-09-28 01:51:47 +01:00
2019-09-28 23:14:16 +01:00
2019-09-28 01:52:11 +01:00
2019-09-28 01:51:47 +01:00
2019-09-28 23:14:16 +01:00
2019-09-28 01:51:47 +01:00
2019-09-27 18:35:21 +01:00
2019-09-28 01:51:47 +01:00

How to run the completed project

Prerequisite

The application has only been tested on Python 3.7.3 x86_64 on Windows. However, I don't see why it wouldn't work on *NIX as well. Note that Windows' default conhost terminal emulator may have problem displaying unicode characters. I personally run it in PyCharm CE or Visual Studio Code Terminal.

  1. Install dependencies requirements.

    pip install -r requirements.txt
    

    If you don't like to install packages to global/user scopes, you can also setup virtual environment

  2. Changing the settings in sync_settings.json. Please validate the JSON files and make sure all the fields are populated with correct value. Incorrect settings are undefined behaviour which means anything can happens from functioning correctly to causing nuclear bomb.

Run the code

Run main.py in the terminal to start the application.

The program accept three optional positional parameters

  • Remote base ItemID (such as ABC12345678DEFG!1234567). If not provided, will use jobs in sync_settings.json.
  • Remote base directory. leave empty or / for root.
  • Local base directory. leave empty for working directory. For Windows, please only use /, such as D:/downloads/OneDrive.

On launch, the program will interactively ask for confirmation before starting any action, unless overridden with -y or --yes.

See --help for more information.

To change logging level, edit setup.py file.

When file conflict occurs, if the file size is different, the program downloads remote and overwrite local copy.

blacklist currently accepts path to file or directory with Unix shell-style wildcards, all relative to root of remote. The same blacklist currently apply to every drive root.

Explaining remote directory

For example

RemoteRoot of ABC12345678DEFG!1234567
├───A
│   ├───A1.png
│   └───A2.png
├───B.jpg
└───C
│   ├───C1.png
│   └───C2.png
├───D.jpg
└───E
    └───E1.png

If the following blacklist is applied,

{
  "blacklist": [
    "A/A2.png",
    "C",
    "D.jpg",
    "E/E1.png"
  ],
  ...
}

the program will only concern these.

RemoteRoot of ABC12345678DEFG!1234567
├───A
│   └───A1.png
└───B.jpg

Launching the program with ./main.py ABC12345678DEFG!1234567 / D:/OneDrive will results in

D:
└───OneDrive
    ├───A
    │   └───A1.png
    └───B.jpg

Launching the program with ./main.py ABC12345678DEFG!1234567 A D:/OneDrive will results in

D:
└───OneDrive
    └───A1.png

Note that the blacklist is still relative to remote root, not A.

Description
No description provided
Readme 42 KiB
Languages
Python 96.1%
Text 1.9%
Batchfile 0.7%
Other 1.3%