Skip to content

Commit

Permalink
Fixed styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandokov committed Nov 13, 2023
1 parent a53d8cb commit 9149846
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Changelog
##### `1.11.0`
* Added `--from-date` and `--to-datezz options to limit the processed files [#202](https://github.com/ivandokov/phockup/pull/202)
* Merged dependabot PRs
* Improved documentation
* Merged dependabot PRs
* Improved documentation
##### `1.10.1`
* Fixed python versions for tests and deployments
##### `1.10.0`
Expand Down
2 changes: 1 addition & 1 deletion phockup.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def parse_args(args=sys.argv[1:]):
files by an additional level after sorting by date.
"""
)

parser.add_argument(
'--from-date',
type=str,
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,14 @@ The date must be specified in format YYYY-MM-DD. Files with unknown date won't b
For example:
```
phockup ~/Pictures/DCIM/NIKOND40 ~/Pictures/sorted --to-date="2017-01-02"
```
```

`--from-date` and `--to-date` can be combined for better control over the files that are processed.

For example:
```
phockup ~/Pictures/DCIM/NIKOND40 ~/Pictures/sorted --from-date="2017-01-02" --to-date="2017-01-03"
```
```

### Missing date information in EXIF
If any of the photos does not have date information you can use the `-r | --regex` option to specify date format for date extraction from filenames:
Expand Down
2 changes: 1 addition & 1 deletion src/phockup.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def process_file(self, filename):
logger.info(progress)
break

date_unknown = file_date == None or output.endswith(self.no_date_dir)
date_unknown = file_date is None or output.endswith(self.no_date_dir)
if self.skip_unknown and output.endswith(self.no_date_dir):
# Skip files that didn't generate a path from EXIF data
progress = f"{progress} => skipped, unknown date EXIF information for '{target_file_name}'"
Expand Down
5 changes: 4 additions & 1 deletion tests/test_phockup.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_get_file_name(mocker):
}

assert Phockup('in', 'out').get_file_name("Bar/Foo.jpg", date) == \
"20170101-01010120.jpg"
"20170101-01010120.jpg"


def test_get_file_name_is_original_on_exception(mocker):
Expand Down Expand Up @@ -474,6 +474,7 @@ def test_skip_unknown():
os.path.isfile(os.path.join(dir4, name))]) == 1
shutil.rmtree('output', ignore_errors=True)


def test_from_date():
shutil.rmtree('output', ignore_errors=True)
Phockup('input', 'output', from_date="2017-10-06")
Expand All @@ -495,6 +496,7 @@ def test_from_date():
os.path.isfile(os.path.join(dir4, name))]) == 1
shutil.rmtree('output', ignore_errors=True)


def test_to_date():
shutil.rmtree('output', ignore_errors=True)
Phockup('input', 'output', to_date="2017-10-06", progress=True)
Expand All @@ -516,6 +518,7 @@ def test_to_date():
os.path.isfile(os.path.join(dir4, name))]) == 0
shutil.rmtree('output', ignore_errors=True)


def test_from_date_to_date():
shutil.rmtree('output', ignore_errors=True)
Phockup('input', 'output', to_date="2017-10-06", from_date="2017-01-02", progress=True)
Expand Down

0 comments on commit 9149846

Please sign in to comment.