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

Append or not append a hash string to the name of a file when to_xml_string() is called #496

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

barikata1984
Copy link
Contributor

@barikata1984 barikata1984 commented Sep 25, 2024

To deal with issue #483 without editing the source code locally, allow users to select to add a hash string after the name of a file when it is registered to VFS by specifying an optional boolean argument filename_with_hash. Sample usage can be found here.

Copy link

google-cla bot commented Sep 25, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@barikata1984 barikata1984 changed the title Dev filename without hash Select to add a hash string after the name of a file when it is registered to VFS Sep 25, 2024
@barikata1984 barikata1984 changed the title Select to add a hash string after the name of a file when it is registered to VFS Allow users to select to append a hash string to the name of a file when to_xml_string() is called and the file is registered to VFS Sep 25, 2024
@barikata1984 barikata1984 changed the title Allow users to select to append a hash string to the name of a file when to_xml_string() is called and the file is registered to VFS Append or not append a hash string to the name of a file when to_xml_string() is called Sep 25, 2024
@yuvaltassa
Copy link
Collaborator

Thanks for this!

  1. Can you please do the CLA thing?
  2. Do I understand correctly that you're changing the default behavior?

@barikata1984
Copy link
Contributor Author

@yuvaltassa

  1. CLA completed.
  2. No, the default behaviour won't change. The default value of filename_with_hash is set at True. This also applies to intermediate methods, e.g. to_xml(), _attributes_to_xml(), and so on, up to get_vfs_filename(). As a result, if a user does not provide filename_with_hash or does explicitly set filename_with_hash=True, a hash string is appended to each file name. Below is just a quick demonstration that calling to_xml_string() without setting filename_with_hash=False registers a file with a hash string appended to the file name:
    Screenshot from 2024-09-26 15-02-13

@yuvaltassa
Copy link
Collaborator

Hopefully @saran-t will get to this soon.

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.

3 participants