Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/inplace #36

Merged
merged 10 commits into from
Aug 12, 2024
Merged

Feature/inplace #36

merged 10 commits into from
Aug 12, 2024

Conversation

AHReccese
Copy link
Member

Reference Issues/PRs

#21

What does this implement/fix? Explain your changes.

Any other comments?

@AHReccese AHReccese added this to the DMeta v0.2 milestone Aug 4, 2024
@AHReccese AHReccese self-assigned this Aug 4, 2024
@AHReccese AHReccese marked this pull request as ready for review August 5, 2024 01:00
@AHReccese AHReccese requested review from sadrasabouri and sepandhaghighi and removed request for sepandhaghighi August 5, 2024 01:00
@AHReccese
Copy link
Member Author

@sadrasabouri reminder!

Copy link
Member

@sadrasabouri sadrasabouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I did my review for this but that was not submitted for an unknown reason.

CHANGELOG.md Outdated
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `pptx` and `xlsx` support
- `get_microsoft_format` function in `util.py`
- `SECURITY.md`
- `inplace` flag in clear, clear_all, update and update_all
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I think it's better to use parameter for function instead of flag
  2. It's better to separate them into three lines

@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `pptx` and `xlsx` support
- `get_microsoft_format` function in `util.py`
- `SECURITY.md`
- `inplace` flag in clear, clear_all, update and update_all
- `inplace` flag in CLI
- `inplace` tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we never reported the addition of tests to change log.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm always not sure what to add or what not to add, I wish we could have a solid formula for this.
I can remove it but in PyMilo we mention per category test case additions, you can check it out in pymilo's CHANGELOG.md

README.md Outdated
@@ -62,30 +62,33 @@ DMeta is an open source Python package that removes metadata of Microsoft Office

## Usage
### In Python
#### Clear metadata for a .docx file
⚠️ You can use the `in_place` flag in functions to indicate if the action should affect the original file(s).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use `in_place` to apply the changes directly to the original file.

README.md Outdated
@@ -96,24 +99,26 @@ update_all(CONFIG_FILE_PATH)

### CLI
⚠️ You can use `dmeta` or `python -m dmeta` to run this program
⚠️ You can use the `inplace` flag in CLI to indicate if the action should affect the original file(s).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use `in_place` to apply the changes directly to the original file.

#### Version
```console
dmeta -v
dmeta --version
```
### Clear metadata for a .docx file
#### Clear metadata for a .docx file in place
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there should be default mode usage of it (with in_place = False) in read me, too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, I'm not sure if I understood your point, could you please re-explain it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad.
I meant, right now all the examples in README (all the above Python scripts) are using in_place=True. It's good to have a Python example for in_place=False (default mode) too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not I guess, in each function, if you do not specify in_place it will fallbacks to False as the default option.
so the clear_all example and the update_all example work in in_place=False mode.
Good?
image

'--inplace',
action="store_true",
default=False,
help="the `inplace` command specifies whether the requested action should be taken in place."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the `in_place` flag applies the changes directly to the original file.

"""
Clear all the editable metadata in the given microsoft file.

:param microsoft_file_name: name of microsoft file
:type microsoft_file_name: str
:param in_place: a flag specifies whether clearance should be taken in place
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

"""
Clear all the editable metadata in any microsoft file in the current directory.


:param in_place: a flag specifies whether clearances should be taken in place
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

"""
Update all the editable metadata in the given microsoft file according to the given config file.

:param config_file_name: name of .json config file
:type config_file_name: str
:param microsoft_file_name: name of microsoft file
:type microsoft_file_name: str
:param in_place: a flag specifies whether update should be taken in place
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

"""
Update all the editable metadata in any microsoft file in the current directory according to the given config file.

:param config_file_name: name of .json config file
:type config_file_name: str
:param in_place: a flag specifies whether update should be taken in place
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

@AHReccese
Copy link
Member Author

Dear Sadra, Thank you so much for your review.
requested changes are applied as much as I understand them, let me know if there is anything else that needs to be changed.
@sadrasabouri

@AHReccese AHReccese requested a review from sadrasabouri August 11, 2024 17:33
Copy link
Member

@sadrasabouri sadrasabouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the addition of the in_place=True Python examples in README.md.

@AHReccese AHReccese requested a review from sadrasabouri August 11, 2024 21:17
@AHReccese
Copy link
Member Author

Just the addition of the in_place=True Python examples in README.md.

Please read my comment above, and if you have any comment to address it better, let me know.

Copy link
Member

@sadrasabouri sadrasabouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sadrasabouri sadrasabouri merged commit 787d254 into dev Aug 12, 2024
42 checks passed
@sadrasabouri sadrasabouri deleted the feature/inplace branch August 12, 2024 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants