documented fs changes

This commit is contained in:
Luxferre
2025-12-22 15:23:41 +02:00
parent 58f5fb4b93
commit 6b0dbb4479
2 changed files with 17 additions and 2 deletions
+17 -1
View File
@@ -64,7 +64,7 @@ Every chat instance exposes the following methods:
The handler accepts two parameters: a message and a state object, and returns the response and the new state object. If the returned state object is `None`, then the chat loop exits. Non-command handler (i.e. what should be done on any user input that doesn't start with a registered command) is registered under the `default` command. The handler accepts two parameters: a message and a state object, and returns the response and the new state object. If the returned state object is `None`, then the chat loop exits. Non-command handler (i.e. what should be done on any user input that doesn't start with a registered command) is registered under the `default` command.
### `deck.fs` (WIP) ### `deck.fs`
FS helper librаry. FS helper librаry.
@@ -72,6 +72,22 @@ Exports the following functions:
- `unlock_rootfs()`: make the device root filesystem read-write (does nothing on desktop) - `unlock_rootfs()`: make the device root filesystem read-write (does nothing on desktop)
- `lock_rootfs()`: make the device root filesystem read-only (does nothing on desktop) - `lock_rootfs()`: make the device root filesystem read-only (does nothing on desktop)
- `stat(path)` (aka `du(path)`): alias to `os.stat` but returning the stats as a dictionary
- `statvfs(path)` (aka `df(path)`): alias to `os.statvfs` but returning the stats as a dictionary
The following `deck.fs` functions are direct aliases to the corresponding `os` call counterparts:
- `sep` = `pathsep` = `os.sep`
- `cwd` = `pwd` = `os.getcwd`
- `ls` = `listdir` = `os.listdir`
- `md` = `mkdir` = `os.mkdir`
- `cd` = `chdir` = `os.chdir`
- `rd` = `rmdir` = `os.rmdir`
- `rm` = `remove` = `os.remove`
- `mv` = `rename` = `move` = `os.rename`
- `sync` = `os.sync` (where supported)
- `env` = `getenv` = `os.getenv`
- `rnd` = `urandom` = `os.urandom`
### `deck.net` ### `deck.net`
-1
View File
@@ -19,7 +19,6 @@ def lock_rootfs():
storage.remount("/", readonly=True) storage.remount("/", readonly=True)
# Some shortcut export bindings to corresponding os functions # Some shortcut export bindings to corresponding os functions
# ['mount', 'putenv', 'stat', 'statvfs', 'system', 'umount', 'unlink', 'unsetenv', 'urandom']
sep = pathsep = os.sep sep = pathsep = os.sep
cwd = pwd = os.getcwd cwd = pwd = os.getcwd