Commit Graph

42 Commits

Author SHA1 Message Date
0e8d568fea main : Use pathlib instead of os.path
Removes every use of os.path and replaces it with the equivalent pathlib
method.
Allows to avoid importing os.
2026-01-08 13:46:01 +01:00
78a4d9df36 gitignore : ignore docs/build
The docs will be added later but to prevent the mess when switching
between branches ignore the build folder.
2026-01-04 19:22:04 +01:00
7dd7b57e1f synchroniser : Use a consistent docstring format.
Edit the docstrings so they use a consistent format.
Also add a short module docstring.
2026-01-04 14:31:16 +01:00
b10ed69d59 defaults : change type of MISC_CACHE_DIR_PATH to str
DEFAULT_MISC_CACHE_DIR_PATH was a Path but the fallbacks of config.get
in config.py will be converted to a string so make it a string instead
and do the conversion later
2026-01-04 12:22:21 +01:00
ec8030fc81 config : fix cache_dir_path value parsing error
Configparser's config.get returns a string and we want a Path. for the
moment convert it to Path directly.
2026-01-03 18:05:43 +01:00
f050dcc94f runners : fix sync runner not synchronising links
The wrong function was call in the sync runner (update_links instead of
sync_links) which mean the links were updated remotly but never
synchronised with the local.
Call sync_links instead.
We keep the call to update_links but set it to be in background.
2026-01-03 18:02:20 +01:00
f40a5c9276 Merge branch 'abstract_defaults'
Abstract the defaults into a seperate file
2026-01-03 17:20:18 +01:00
0e80ba0b0d config : use the defaults from defaults.py
Remove the defaults from the dataclasses as they are redundent with the
fallbacks of configparser.
Use the values in defaults.py as the fallbacks instead of hardcoded
values.
2026-01-03 17:18:19 +01:00
a223f04909 config : take cache_dir_path into account
cache_dir_path and all of the OtherConfig was ignored and the default
value was loaded, read its value from the config file instead.
2026-01-03 17:15:22 +01:00
e42ae71862 defaults : Create defaults.py
Creates the file defaults.py this is used to store the defaults and
easily include them into the config.
Changing defaults is thus possible without touching the code leaving
less room for errors.
2026-01-03 17:10:06 +01:00
58c7f7d1be Add main as a script with poetry 2026-01-03 16:39:00 +01:00
eefb21faff Mark local imports as such.
Prefix local imports with "unisync." so they are not mistaken with
external modules imports
2026-01-03 16:24:58 +01:00
941c467fc2 Bump copyright year and add missing file headers 2026-01-02 10:58:27 +01:00
4dcab777ca Merge branch 'dev'
Got to a state that seems stable enough to go into main
2026-01-02 10:45:00 +01:00
a169890351 main : adds subcommands, move to Path and improve
Multiple changes to the main file, after this unisync becomes kind of
usable.
Add subcommands : this uses the 2 previous commits to add the
subcommands to unisync it is now possible to sync, add and mount.
pathlib : move from PosixPath to Path
Remove unused imports
Rename base_namespace to cli_args
Add some comments and TODOs
2026-01-02 10:44:59 +01:00
b70070ba1a argparser : adds subcommands to the argparser
this adds subcommands to the argparser using subparsers, we also set a
default value for func depending on which of the subcommands is
selected.
Also change the formatting of the epilog so it is on two lines.
2026-01-02 10:44:58 +01:00
bd72d740e6 runners : Create runners file and basic runnners
This adds runners.py, it contains a set of functions that peform all the
various task that unisync can do (sync, add and mount for now).
They are simple function that put together all the rest.
2026-01-02 10:44:57 +01:00
e43c16adb3 paths : fixes write_new_paths writing of the file
I was writing the file using 'w' instead of 'a' so the old paths were
deleted use 'a'.
2026-01-02 10:44:56 +01:00
10200fceb9 config : fallback to port 22 instead of None
The configparser fallback option for port was None set it to use 22
instead as None doesn't make sense
2026-01-02 10:44:55 +01:00
27924013d9 Bug fixes and small improvements
Fix :
- paths : true instead of True
- paths : Path has no len convert to str first to get the number of
  characters

Improvements :
- Replace all PosixPath by Path
2026-01-01 17:24:46 +01:00
138bc6d24a Update README to reflect the state of the project 2025-12-31 00:04:53 +01:00
48179034a7 Adds prerequisites to README 2025-12-31 00:03:59 +01:00
f9001ecb9d Adds usage of the paths manager 2025-12-31 00:03:17 +01:00
86a6c8acce Adds error handling for the paths 2025-12-30 17:56:03 +01:00
4f6f48247d Add classes for error handling 2025-12-30 17:54:47 +01:00
8caba75060 Adds paths adding functionnality
Adds functions that allows adding new paths to the synchronisation.
When writing the new paths to the file if a parent directory is
synchronised all the childrens are removed.
2025-08-10 18:21:10 +02:00
b35391f1f9 Adds an Other category to the config
This creates a new optionnal category in the config called other that is
used to configure various aspects of unison.
Currently it only allows to customise the path to the cache directory
which is ~/.unisync by default
2025-07-31 11:47:44 +02:00
c5992ef19e Adds get_paths_to_sync and organise it in a class
This refactors the paths functions in a class called PathsManager
allowing to share some data like the Paths to the various directories
unisync works with.
This commit also creates the get_paths_to_sync method which simply reads
the paths file and returns its content as a list
2025-07-31 11:45:17 +02:00
837cc1bcf4 Adds mount_remote_dir
Adds the mount_remote_dir method to the synchroniser, this allows to
mount the remote directory in order to access it with the generated
links.
Also adds the background parameter to the documentation of update_links
2025-07-28 15:31:40 +02:00
87db8a0498 Adds links generation and update
Adds update_links to the synchroniser which updates the links.
It should also be able to generate links on the first run.
2025-07-27 17:46:37 +02:00
11513adf48 Improves user_select_files documentation 2025-07-25 12:02:25 +02:00
aaa4ef61d5 Adds beginning of paths management
The paths file will be used for everything related to the paths to
synchronise.
Adds the user_select_files functions that allows the user to select
paths
2025-07-24 15:59:42 +02:00
fec09b6d0b Adds comments to the dataclasses in config 2025-07-24 15:48:13 +02:00
2566458e25 Complete README 2025-07-11 23:21:41 +02:00
14eb531e4a Adds unison config and test code
This adds the possiblity to pass configuration options directly to
unison via the configuration file.
Also adds some test code to main.py
2025-07-11 00:30:05 +02:00
c980dc352a Adds a basic main file 2025-07-05 22:52:38 +02:00
1c067f83d8 Adds argparser for parsing CLI arguments 2025-07-05 22:51:14 +02:00
b29aa41d1a Adds pycache to gitignore 2025-06-29 21:07:32 +02:00
35d30f4a75 Removes test code from synchroniser 2025-06-28 10:44:26 +02:00
6ffb410a4f Adds config file reader
Adds a config file reader and dataclasses to save it using configparser
from the standard library.
2025-06-28 10:41:23 +02:00
33a6d09dba Adds licensing informations 2025-06-14 19:22:18 +02:00
96e86d5c76 First commit
Project created using poetry and some code is written
2025-06-14 16:14:28 +02:00