这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@timothycarambat
Copy link
Member

resolves #418

@timothycarambat timothycarambat merged commit ce9233c into master Dec 11, 2023
@timothycarambat timothycarambat deleted the 418-html-uploads branch December 11, 2023 22:40
@timothycarambat
Copy link
Member Author

Screen Shot 2023-12-11 at 2 38 58 PM

@review-agent-prime
Copy link

collector/scripts/watch/convert/as_html.py

Instead of using kwargs.get() for each argument in the as_html function, it would be more Pythonic and readable to define these arguments in the function signature itself. This way, you can provide default values for each argument and it will be easier to understand what arguments the function expects.
Create Issue
See the diff
Checkout the fix

    def as_html(directory='hotdir', filename=None, ext='.html', remove_on_complete=False):
      fullpath = f"{directory}/{filename}{ext}"
      ...
git fetch origin && git checkout -b ReviewBot/Impro-86mjh5q origin/ReviewBot/Impro-86mjh5q

Comment on lines +8 to +13
def as_html(**kwargs):
parent_dir = kwargs.get('directory', 'hotdir')
filename = kwargs.get('filename')
ext = kwargs.get('ext', '.html')
remove = kwargs.get('remove_on_complete', False)
fullpath = f"{parent_dir}/{filename}{ext}"

Choose a reason for hiding this comment

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

The function signature has been updated to include the optional arguments directly, with their default values. This makes the function more readable and maintainable, as it's easier to understand what arguments the function expects.

Suggested change
def as_html(**kwargs):
parent_dir = kwargs.get('directory', 'hotdir')
filename = kwargs.get('filename')
ext = kwargs.get('ext', '.html')
remove = kwargs.get('remove_on_complete', False)
fullpath = f"{parent_dir}/{filename}{ext}"
def as_html(directory='hotdir', filename=None, ext='.html', remove_on_complete=False):
fullpath = f"{directory}/{filename}{ext}"
...

cabwds pushed a commit to cabwds/anything-llm that referenced this pull request Jul 3, 2025
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.

Document Upload file type HTML

2 participants