Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
fluff: Correct a couple of variable naming issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
hbayindir committed Jun 4, 2022
1 parent 171ae05 commit b2cb971
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## 2022-06-04

- fix: Correct logging messages corrupted by overzelaous refactoring.
- fluff: Correct a couple of variable naming issues.
- code: Bump version to 0.0.5.

## 2022-04-27
Expand Down
8 changes: 4 additions & 4 deletions src/magazine_renamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def convert_edition_string(edition_string):
local_logger.debug('Simulation state is %s', str(arguments.simulate))

# We're going to match some regular expressions. We'll compile them here for conciseness.
regex_ieee_spectrum_v_1 = re.compile('Spectrum_[\d]{5}_[A-Z][a-z]{2}_[\d]{4}\.PDF')
regex_ieee_spectrum_v_2 = re.compile('[\d]{2}_Spectrum_[\d]{4}\.pdf')
regex_ieee_spectrum_v1 = re.compile('Spectrum_[\d]{5}_[A-Z][a-z]{2}_[\d]{4}\.PDF')
regex_ieee_spectrum_v2 = re.compile('[\d]{2}_Spectrum_[\d]{4}\.pdf')
regex_ieee_spectrum_v2a = re.compile('[\d]{2}_Spectrum_[\d]{4}[_][A-Z]{2,3}\.pdf')
regex_ieee_spectrum_v2b = re.compile('[\d]{2}_Spectrum_[\d]{4}[\.][A-Z]{2,3}\.pdf')
regex_ieee_spectrum_v2c = re.compile('[\d]{2}_Spectrum_[\d]{2}\.pdf')
Expand Down Expand Up @@ -151,7 +151,7 @@ def convert_edition_string(edition_string):
local_logger.debug('File name is \'%s\', with extension \'%s\'', file_name, file_extension)

#IEEE Spectrum, V1.
if regex_ieee_spectrum_v_1.match(file_to_rename):
if regex_ieee_spectrum_v1.match(file_to_rename):
local_logger.info('%s is an IEEE Spectrum Magazine file, with V1 format.', file_to_rename)

# First divide file name into its parts via split.
Expand All @@ -168,7 +168,7 @@ def convert_edition_string(edition_string):
new_file_name = 'IEEE Spectrum ' + file_name_parts[3] + '-' + month_number + file_extension.lower()
local_logger.info('File will be renamed to \'%s\'.', new_file_name)

elif regex_ieee_spectrum_v_2.match(file_to_rename):
elif regex_ieee_spectrum_v2.match(file_to_rename):
local_logger.info('%s is an IEEE Spectrum Magazine file, with V2 format.', file_to_rename)

# This one is actually easy, since we're just going to rearrange some fields together.
Expand Down

0 comments on commit b2cb971

Please sign in to comment.