Welcome to SafeMyWork’s documentation!

The current version is 0.5.

https://github.com/Thykof/SafeMyWork

SafeMyWork is intended for people who handle a lot of files which can be texts, images, songs… The aim is to avoid losing documents.

How it works

SafeMyWork looks for your modified files and copies them to another directory. The second feature is the synchronization of two folders.

Automatic saving

Run SafeMyWork and select your working folders. Then while you are working, every a certain amount of time, all files in this folder will be copied into a separate folder. It keeps your files safe if you forget to save your work or delete accidentally files.

Synchronization

The application can synchronize two folders. After scanning the two folders selected by the user, a dialog message shows potential conflicts. A conflict occurs when a file has the same path and the same name in both folders. The user selects the file that she/he wants to keep. The size of the files and the last modification time are shown to help the choose. Then, a dialog shows what files would be lost (conflict resolution) and what files would be created (missing files in a folder).

Safer: save files

Sync: synchronize folders

class safer.sync.Sync(local_path, ext_path)
set_safe_doc(safe_doc)
set_config(config)
scan_dir(dirname)
scan_compare(local_path=None, ext_path=None)
sync(comparison=None)
exec_sync(local_path=None, ext_path=None)
compare(locals_files=None, ext_files=None)
solve_conflicts()
change_dst(path_type, num)
add_in_local(filename)
remove_in_local(filename)
add_in_ext(filename)
remove_in_ext(filename)

A module for simple functions

Define some functions.

safer.helpers.combine_list(list1, list2)

Create a list with only elements in common of the two lists.

Parameters:
  • list1 (list) – the first list
  • list2 (list) – the second list
Returns:

the created list

Return type:

list

safer.helpers.path_without_root(path)

Return the path without the first directory.

e.g. “root/foo/bar” -> “foo/bar”

safer.helpers.missing_item(list1, list2)

Return the list of directories in list1 but not in list2.

safer.helpers.split_path(path)

Return a list with all directory names in the given path.