Skip to content

Conversation

@EsipovPA
Copy link

@EsipovPA EsipovPA commented Oct 3, 2023

Should resolve this issue: #106

Removed code duplicates.

for entry_path in path_list:
if entry_path.is_dir():
self._i.add_watch(str(entry_path), self._mask)
for sub_entry_path in entry_path.rglob('*'):
Copy link
Owner

Choose a reason for hiding this comment

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

Let's just stick with listdir(), which is going to be much more efficient.

Also, it'd be better to do (for example):

if entry_path.is_dir() is False:
    continue

..which will reduce nesting.

"adding a watch on it (because we're "
"being recursive): [%s]", full_path)


Copy link
Owner

Choose a reason for hiding this comment

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

Not necessary.

import time

from errno import EINTR
from typing import List
Copy link
Owner

Choose a reason for hiding this comment

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

It's probably fine to use native lists for the type hints.

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.

2 participants