module: text_file¶
text_file.py - describe any text file used by an EPICS IOC
code | description |
---|---|
read() |
get a file either from the cache or from storage |
items() |
get the cache as a set of dictionary items |
keys() |
get the names of files in the cache |
values() |
get the Python objects of items in the cache |
remove_comments() |
strip out a C-style comment |
FileNotFound |
Exception: raised when filename does not exist |
_FileCache |
(internal) supports “load each file only once” |
_TextFile |
(internal) superclass: common handling of text file |
Example:
# filename must have all macros expanded
file_object = text_file.read(filename)
-
iocdoc.text_file.
read
(filename)[source]¶ get a file either from the cache or from storage
Parameters: filename (str) – relative or absolute path to file Always use filenames with all macros expanded.
Ok? filename Ok st.cmd
Ok ./testfiles/templates/example.template
not Ok $(SSCAN)/sscanApp/Db/scanParms.db