Watchdog: ํ™•์žฅ๋œ ์‚ฌ์šฉ์ž(Pathlib)์˜ ๋ฌธ์ž์—ด์„ ๊ด€์ฐฐ์ž.schedule์— ์ „๋‹ฌํ•˜๋ฉด ์ž˜๋ชป๋œ ๋ช…๋ น 4๊ฐ€ ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2020๋…„ 07์›” 10์ผ  ยท  4์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: gorakhargosh/watchdog

์ œ๋ชฉ์— ๋”ฐ๋ผ ์ฃผ์„ ์ฒ˜๋ฆฌ๋œ ์ฝ”๋“œ๋Š” ์ž‘๋™ํ•˜์ง€๋งŒ Pathlib๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ž˜๋ชป๋œ ๋ช…๋ น 4๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ํ„ฐ๋ฏธ๋„์— ๋Œ€ํ•œ ๊ฒฝ๋กœ๋ฅผ ์ธ์‡„ํ•˜๋ฉด ๊ฒฝ๋กœ๊ฐ€ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์„ค์ •๋˜์—ˆ์Œ์„ ๋ณด์—ฌ์ฃผ๊ณ  observer.schedule ํ–‰์„ ์ฃผ์„ ์ฒ˜๋ฆฌํ•˜๋ฉด ์˜ค๋ฅ˜ ์—†์ด ํ”„๋กœ๊ทธ๋žจ์ด ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค.

class ObserverLoop:
    def __init__(self):
        self.folder = Path("~/Desktop")
        print(self.folder.expanduser())
        # self.working_path = os.path.abspath(os.path.expanduser("~/" + "/Desktop/"))
        self.working_path = self.folder.expanduser()
        print(self.working_path)
        self.event_handler = MonitorFolderChanges(self.working_path)

    def start_loop(self):
        tf.key = secrets.api_key
        observer = Observer()

        observer.schedule(self.event_handler, self.working_path, recursive=False)
        observer.start()

        try:
            while observer.is_alive():
                observer.join(1)
        except KeyboardInterrupt:
            observer.stop()

        observer.join()
not a bug

๋ชจ๋“  4 ๋Œ“๊ธ€

์–ด๋–ค ๋ฒ„์ „์˜ ์›Œ์น˜๋…?

์ตœ์‹  ๋ฒ„์ „ 0.10.2๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

ํ˜„์žฌ ์ตœ์‹  ๋ฒ„์ „์ธ 0.10.3์œผ๋กœ ์‹œ๋„ํ•ด ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? ์—ฌ๊ธฐ์—๋Š” ๊ฒฝ๋กœ์™€ ์œ ์‚ฌํ•œ ๊ฐœ์ฒด๋ฅผ ์ง€์›ํ•˜๋Š” ์ˆ˜์ • ์‚ฌํ•ญ์ด ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค(https://github.com/gorakhargosh/watchdog/releases/tag/v0.10.3 ์ฐธ์กฐ).

ํ•ด๊ฒฐํ•ด ์ฃผ์…”์„œ ๊ฐ์‚ฌ๋“œ๋ฆฌ๋ฉฐ, ๋‹ต๋ณ€์ด ๋Šฆ์–ด ์ฃ„์†กํ•ฉ๋‹ˆ๋‹ค. ๋ฌธ์ œ์˜ ์ฃผ๋œ ์ด์œ ๋Š” brew upgrade ํ•˜๋ ค๊ณ  ํ•  ๋•Œ ์ตœ์‹  ๋ฒ„์ „์ด ์ œ๊ณต๋˜์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰