Usage#
The easiest way to get started with running RFS scripts is to launch one using uv. When you use the
uv run command, it will automatically use the virtual environment associated with the project, so
it's not necessary to enable the virtual environment in your terminal.
Running Scripts as Modules#
It is important to note that because of the project's structure, scripts must be run as
modules. So instead of moving to the /main/van/ directory and
using uv run run.py to launch the run.py script, you would remain in the rfs_data/
folder in the terminal and instead run uv run -m main.van.run.
Breaking down this syntax:
- We've added the
-mflag to theuv runcommand, which will prime the interpreter to look for a module - We've given the interpreter a path to the file we want to run starting from the root folder,
rfs_data, using.as a directory separator instead of/. - We've omitted the .py extension on the
run.pyfile
Using this syntax you can run any file in the project from the rfs_data/ folder.
Unhosted Token Folders#
Many scripts have a need for sensitive data like login information. This data is generally stored in token
files in a folder named .etc within the script's own folder. These folders are excluded from github,
so during setup you will need to create the folder before either placing the correct token file in it or
creating your own as appropriate.
Not all versions of Windows will allow you to easily create a folder starting with a dot. If you run into problems, opening the folder in vscode should allow you to create the folder via its explorer window.
Chrome Profiles#
Some scripts create their own chrome profiles programmatically, these profiles are stored in the folder
/main/chrome_profiles, which will be created the first time a script creates a profile. Each instance
is in a folder called instance_x where X is a number. When a profile is in use, a file called
rfs.lock will be created in the instance folder. When the script is done with this profile, the lock
file is normally deleted. However, if the script exits suddenly due to an error or a forced exit, the file
will sometimes remain. If this happens, that profile will not be used until the lock file is manually deleted,
which can cause a buildup of unnecessary profiles.
Headless Bots#
Scripts that run Selenium bots will include a headless option in the configuration file(s). If this is
set to True
Forcing a Script to Exit#
If a script hangs due to an error, or if you are stuck in an input loop (some scripts currently have no way to cleanly exit a portion of the script that requires input) or you need to restart for any reason, you can press ctrl+c in the terminal window to cancel the execution of a script running in that window/tab. Some scripts will clean up downloaded and temporary files upon this kind of forced exit, but it is best practice to manually check the folders where these files are created and clean them out where necessary if you have to force an exit.