L iT0UddlmZddlZddlmZmZddlZddlmZm Z m Z ddl m Z erddl mZGddZed ee zeezZd ed <dd Zdd Z dddd ddZ d ddZ dddd ddZddZddZy)) annotationsN) TYPE_CHECKING TypeAlias)cli_utilconfigenv_util)PollingPathWatcher)Callablec.eZdZddd ddZy)NoOpPathWatcherNF glob_patternallow_nonexistentcyN)self _path_str _on_changedrrs d/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/watcher/path_watcher.py__init__zNoOpPathWatcher.__init__%s ) rstrrCallable[[str], None]r str | NonerboolreturnNone)__name__ __module__ __qualname__rrrrr r $s? $("'   + !      rr z@streamlit.watcher.event_based_path_watcher.EventBasedPathWatcherrPathWatcherTypec, ddl}y#t$rYywxYw)z*Check if the watchdog module is installed.rNTF)watchdog ImportError)r$s r_is_watchdog_availabler&:s s  ctjddvrPtsEtjrdnd}t j dddt j |d yyy) Nserver.fileWatcherType)pollnonez $ xcode-select --installz6 For better performance, install the Watchdog module:blueT)fgboldz& $ pip install watchdog )r get_optionr&r IS_DARWINr print_to_cli)msgs rreport_watchdog_availabilityr3Dsn23;KK&(080B0B, D    ) LrFr cr|tjd}t|}|tury|||||y)a&Create a PathWatcher for the given path if we have a viable PathWatcher class. Parameters ---------- path Path to watch. on_path_changed Function that's called when the path changes. watcher_type Optional watcher_type string. If None, it will default to the 'server.fileWatcherType` config option. glob_pattern Optional glob pattern to use when watching a directory. If set, only files matching the pattern will be counted as being created/deleted within the watched directory. allow_nonexistent If True, allow the file or directory at the given path to be nonexistent. Returns ------- bool True if the path is being watched, or False if we have no PathWatcher class. r(Fr T)rr/get_path_watcher_classr )pathon_path_changed watcher_typerr watcher_classs r _watch_pathr:WsJD(()AB *<8M' !+  rct|||Sr)r:)r6on_file_changedr8s r watch_filer=s t_l ;;rcbtjj|d}t|||||S)Nr+r )osr6joinr:)r6on_dir_changedr8rrs r watch_dirrBs4 77<<b !D  !+  rc>ttjdS)zsReturn the class to use for path changes notifications, based on the server.fileWatcherType config option. r()r5rr/rrrget_default_path_watcher_classrDs "&"3"34L"M NNrcN|dvrtrddlm}|S|dvrtStS)zReturn the PathWatcher class that corresponds to the given watcher_type string. Acceptable values are 'auto', 'watchdog', 'poll' and 'none'. >autor$r)EventBasedPathWatcher>rFr))r&*streamlit.watcher.event_based_path_watcherrGr r )r8rGs rr5r5s1++0F0HT$$''!! r)rr)rrr) r6rr7rr8rrrrrrr)r6rr<rr8rrr) r6rrArr8rrrrrrr)rr")r8rrr") __future__rr?typingrrstreamlit.watcher streamlitrrr&streamlit.watcher.polling_path_watcherr collections.abcr r typer"__annotations__r&r3r:r=rBrDr5rrrrQs@# +00E(    KL  ? , $/ $# / /*//  /  / /j $< <*<< < $ $#  )     *O r