Compare commits
2 commits
40d24186ff
...
c71997b4f4
Author | SHA1 | Date | |
---|---|---|---|
c71997b4f4 | |||
4494d9750a |
2 changed files with 21 additions and 13 deletions
|
@ -136,7 +136,7 @@ the following environment variables can be set:
|
||||||
how many workers to use for repository duplication,
|
how many workers to use for repository duplication,
|
||||||
default is how many cpu threads are available
|
default is how many cpu threads are available
|
||||||
|
|
||||||
the following command line arguments can be used:
|
the following command line flags can be used:
|
||||||
|
|
||||||
- `--skipsotaignoregen`
|
- `--skipsotaignoregen`
|
||||||
skips generating a `.sotaignore` file,
|
skips generating a `.sotaignore` file,
|
||||||
|
@ -145,6 +145,9 @@ the following command line arguments can be used:
|
||||||
- `--test`
|
- `--test`
|
||||||
does everything except actually pushing to GitHub
|
does everything except actually pushing to GitHub
|
||||||
|
|
||||||
|
- `--dupethelongway`
|
||||||
|
duplicates the repository wholly, disrespecting any .gitignore files
|
||||||
|
|
||||||
there's more, but god forbid you need to use them unless you're changing the script,
|
there's more, but god forbid you need to use them unless you're changing the script,
|
||||||
search for `argv` in the script if you're comfortable with dragons
|
search for `argv` in the script if you're comfortable with dragons
|
||||||
|
|
||||||
|
@ -191,7 +194,7 @@ the following environment variables can be set:
|
||||||
the large file finding algorithm
|
the large file finding algorithm
|
||||||
(now called SideStepper because names are fun, sue me)
|
(now called SideStepper because names are fun, sue me)
|
||||||
|
|
||||||
the following command line arguments can be used:
|
the following command line flags can be used:
|
||||||
|
|
||||||
- `--parallel`
|
- `--parallel`
|
||||||
same behaviour as setting the `SOTA_SIDESTEP_PARALLEL` environment variable
|
same behaviour as setting the `SOTA_SIDESTEP_PARALLEL` environment variable
|
||||||
|
@ -287,4 +290,3 @@ comma-separate multiple licences, and use code blocks if you need to list multip
|
||||||
- Interior Pots And Pans: https://hexclad.com/products/pots-and-pans-set
|
- Interior Pots And Pans: https://hexclad.com/products/pots-and-pans-set
|
||||||
- Interior Kitchen
|
- Interior Kitchen
|
||||||
Cabinets: https://www.thesimsresource.com/downloads/details/category/sims4-sets-objects-kitchen/title/dream-kitchen-set-pt-1/id/1680892/
|
Cabinets: https://www.thesimsresource.com/downloads/details/category/sims4-sets-objects-kitchen/title/dream-kitchen-set-pt-1/id/1680892/
|
||||||
|
|
||||||
|
|
26
sync.py
26
sync.py
|
@ -56,6 +56,10 @@ class CopyHighway:
|
||||||
multithreaded file copying class that gives a copy2-like function
|
multithreaded file copying class that gives a copy2-like function
|
||||||
for use with shutil.copytree(); also displays a progress bar
|
for use with shutil.copytree(); also displays a progress bar
|
||||||
"""
|
"""
|
||||||
|
pool: ThreadPool
|
||||||
|
pbar: tqdm
|
||||||
|
lff_result: LargeFileFilterResult
|
||||||
|
respect_ignore: bool = True
|
||||||
|
|
||||||
def __init__(self, message: str, total: int, lff_result: LargeFileFilterResult):
|
def __init__(self, message: str, total: int, lff_result: LargeFileFilterResult):
|
||||||
"""
|
"""
|
||||||
|
@ -80,6 +84,7 @@ class CopyHighway:
|
||||||
leave=False,
|
leave=False,
|
||||||
)
|
)
|
||||||
self.lff_result = lff_result
|
self.lff_result = lff_result
|
||||||
|
self.respect_ignore = False if "--dupethelongway" in argv else True
|
||||||
|
|
||||||
def callback(self, a: R):
|
def callback(self, a: R):
|
||||||
self.pbar.update()
|
self.pbar.update()
|
||||||
|
@ -88,17 +93,18 @@ class CopyHighway:
|
||||||
def copy2(self, source: Path | str, dest: Path | str) -> None:
|
def copy2(self, source: Path | str, dest: Path | str) -> None:
|
||||||
"""shutil.copy2()-like function for use with shutil.copytree()"""
|
"""shutil.copy2()-like function for use with shutil.copytree()"""
|
||||||
|
|
||||||
# ignore check 1: dir
|
if self.respect_ignore:
|
||||||
for ign_dir in self.lff_result.ignore_directories:
|
# ignore check 1: dir
|
||||||
if str(ign_dir) in str(source):
|
for ign_dir in self.lff_result.ignore_directories:
|
||||||
return None
|
if str(ign_dir) in str(source):
|
||||||
|
return None
|
||||||
|
|
||||||
# ignore check 2: file
|
# ignore check 2: file
|
||||||
# ... we don't need to use the trytrytry method
|
# ... we don't need to use the trytrytry method
|
||||||
# ... because we already did that as part of the large file filter,
|
# ... because we already did that as part of the large file filter,
|
||||||
# ... and as such we checked for it with the first check above
|
# ... and as such we checked for it with the first check above
|
||||||
if self.lff_result.matcher.match(source):
|
if self.lff_result.matcher.match(source):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
self.pool.apply_async(copy2, args=(source, dest), callback=self.callback)
|
self.pool.apply_async(copy2, args=(source, dest), callback=self.callback)
|
||||||
|
|
||||||
|
|
Reference in a new issue