Skip to content

Feature/parallel copy#420

Merged
vikdevelop merged 4 commits intovikdevelop:mainfrom
ArthurValadares:feature/parallel-copy
Jul 8, 2025
Merged

Feature/parallel copy#420
vikdevelop merged 4 commits intovikdevelop:mainfrom
ArthurValadares:feature/parallel-copy

Conversation

@ArthurValadares
Copy link
Copy Markdown
Contributor

Pull request

Description

Implementation with the copy of the configuration files in parallel.

In order to reduce the time needed to copy the files from the source directories, changes were made to the structure that was previously based on calls to os.system using shutil in order to use ThreadPoolExecutor to allow copying in parallel; by default, 3 copies are made at the same time.

The calls were fragmented throughout the file, they were consolidated based on whether they were mandatory, optional or within the scope of the configuration. In addition, the appropriate documentation has been added.

Related Issue

Changes Made

  • Added new feature: Parallel Copy.
  • Updated documentation: New functions and classes documented.
  • Create DesktopEnviroment enum.
  • Separate duties.
    • Config
    • Save
    • Import

Testing

Select the installation methods on which you tested your changes:

  • Flatpak
  • Snap
  • Native version from this repository

Checklist

  • I have read the contributing guidelines.
  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation accordingly.
  • My changes do not introduce any new warnings.

implementation with the copy of the configuration file parallel.

Previously, the files were sequentially copied and the copy
instructions called `os.system` besides being fragmented
along the file. The new approach adopted implements a more
idiomatic form to treat desktop environments and a lazy copy
process, that is, in the construction of the object, based on
the user's and the preferences of the user, the set of files to be
copied is created to, only with the call of the `run` method, to be
performed in parallel.

In order to increase the maintenance and legibilization of the code,
the attributions were properly separated and the type notes, in most
cases were created.

The original attributions of this file were divided into:

- Prepare the environment;
- Copy;
- Collaborative actions;

The environment preparation actions have been moved to the `setup`
method which, thanks to 'SandwichMeta', are executed before `run`,
`run` which contains the actions to be executed - it is indicated
to execute '__parallel_copy' within the method -, the copy actions
have been abstracted in '__parallel_copy', the changes after 'run'
must be in 'teardown'.
issue vikdevelop#414 of SaveDesktop - the original repository. It fixes the
visibility of the `__parallel_copy` method - renaming it to
`_parallel_copy` -; It also decreases the number of 'MAX_WORKERS'
from 5 to 3.

Future actions include reviewing the method of copying user data
from Flatpak applications in view of the high consumption of
computational resources and notorious delay, which hinders the
initial objective of using parallelism.
and fixes the saving of the data files of all flatpaks despite not
selecting them. Check out [this comment](vikdevelop#414 (comment))
on issue vikdevelop#414.
@vikdevelop
Copy link
Copy Markdown
Owner

I tried it and everything works perfectly – great job!
Thank you very much for the time you invested in this contribution. 👍
If you’d like to contribute again in the future, you’re more than welcome!

@vikdevelop vikdevelop merged commit 7f2bec0 into vikdevelop:main Jul 8, 2025
vikdevelop added a commit that referenced this pull request Jul 8, 2025
…y upgrade (#420)

During thorough testing following the config.py upgrade from PR #420, I identified and resolved several issues:

- Fixed incorrect saving of folders in the archive (e.g., ~/.fonts exported only contents, not the ./fonts folder as expected)
- Ensured the ‘cache’ folder for Flatpak application data is properly excluded

Additionally, updated related scripts:
- main_window.py and periodic_saving.py now exclude saving_status and cfg.sd.zip files during save
- synchronization.py: simplified condition for removing sync_status

These changes should make the export/import process more reliable and consistent. Still, thanks to contributor @ArthurValadares for his work on the config.py upgrade!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature_request: Speed up the process of saving and importing.

2 participants