lemonpie-cli 0.1.0__tar.gz → 0.2.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1}/.github/workflows/release.yml +10 -0
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1}/.gitignore +2 -5
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1}/PKG-INFO +39 -22
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1}/README.md +144 -129
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1}/pyproject.toml +11 -6
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1/src}/lemonpie/_version.py +2 -2
- lemonpie_cli-0.2.0a1/src/lemonpie/cli/__init__.py +0 -0
- lemonpie_cli-0.1.0/lemonpie/lm.py → lemonpie_cli-0.2.0a1/src/lemonpie/main.py +1 -0
- lemonpie_cli-0.2.0a1/src/lemonpie/paths.py +26 -0
- lemonpie_cli-0.2.0a1/uv.lock +256 -0
- lemonpie_cli-0.1.0/lemonpie/paths.py +0 -20
- lemonpie_cli-0.1.0/sessions/.gitkeep +0 -1
- lemonpie_cli-0.1.0/uv.lock +0 -548
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1}/.github/workflows/publish.yml +0 -0
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1}/LICENSE +0 -0
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1}/config.example.json +0 -0
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1}/docs/design/state-machine.md +0 -0
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1/src}/lemonpie/__init__.py +0 -0
- /lemonpie_cli-0.1.0/lemonpie/lm_config.py → /lemonpie_cli-0.2.0a1/src/lemonpie/cli/config_cmd.py +0 -0
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1/src}/lemonpie/cli_utils.py +0 -0
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1/src}/lemonpie/config.py +0 -0
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1/src}/lemonpie/model_utils.py +0 -0
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1/src}/lemonpie/session_utils.py +0 -0
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1/src}/lemonpie/spinner.py +0 -0
- {lemonpie_cli-0.1.0 → lemonpie_cli-0.2.0a1/src}/lemonpie/time_utils.py +0 -0
|
@@ -18,6 +18,16 @@ jobs:
|
|
|
18
18
|
with:
|
|
19
19
|
fetch-depth: 0
|
|
20
20
|
|
|
21
|
+
- name: Verify tag is reachable from main
|
|
22
|
+
run: |
|
|
23
|
+
git fetch origin main
|
|
24
|
+
if git merge-base --is-ancestor "${{ github.sha }}" origin/main; then
|
|
25
|
+
echo "Tag ${{ github.ref_name }} (commit ${{ github.sha }}) is on main. Proceeding."
|
|
26
|
+
else
|
|
27
|
+
echo "::error::Tag ${{ github.ref_name }} (commit ${{ github.sha }}) is not reachable from origin/main. Refusing to publish — merge to main before tagging."
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
30
|
+
|
|
21
31
|
- name: Install uv
|
|
22
32
|
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
|
23
33
|
with:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: lemonpie-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0a1
|
|
4
4
|
Summary: LemonPie — A lightweight Ollama client for terminal users
|
|
5
5
|
Project-URL: homepage, https://versicode.com/lemonpie
|
|
6
6
|
Project-URL: repository, https://github.com/famousStratum/LemonPie
|
|
@@ -8,8 +8,10 @@ Project-URL: issues, https://github.com/famousStratum/LemonPie/issues
|
|
|
8
8
|
Author-email: famousStratum <info@versicode.com>
|
|
9
9
|
License-Expression: GPL-3.0-or-later
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Requires-Dist: httpx
|
|
12
13
|
Requires-Dist: ollama
|
|
14
|
+
Requires-Dist: platformdirs
|
|
13
15
|
Description-Content-Type: text/markdown
|
|
14
16
|
|
|
15
17
|
# LemonPie
|
|
@@ -25,8 +27,8 @@ LemonPie is a compact CLI for interacting with an Ollama server. It manages chat
|
|
|
25
27
|
|
|
26
28
|
## ✨ Features
|
|
27
29
|
- Start and manage chat sessions with Ollama models
|
|
28
|
-
- Persist session history
|
|
29
|
-
- Configure host, default model, and aliases via
|
|
30
|
+
- Persist session history in your OS's standard user data directory
|
|
31
|
+
- Configure host, default model, and aliases via a config file in your OS's standard user config directory
|
|
30
32
|
- Add, remove, and list models with aliases (`lmConfig`)
|
|
31
33
|
- Switch models mid‑session with confirmation
|
|
32
34
|
- Atomic writes for safety (tmp + replace)
|
|
@@ -38,25 +40,41 @@ LemonPie is a compact CLI for interacting with an Ollama server. It manages chat
|
|
|
38
40
|
## 📂 Project Structure
|
|
39
41
|
|
|
40
42
|
```text
|
|
41
|
-
|
|
42
|
-
├──
|
|
43
|
-
│
|
|
44
|
-
│
|
|
45
|
-
│
|
|
46
|
-
│
|
|
47
|
-
│
|
|
48
|
-
│
|
|
49
|
-
├──
|
|
50
|
-
├──
|
|
51
|
-
├──
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
LemonPie/
|
|
44
|
+
├── src/
|
|
45
|
+
│ └── lemonpie/ # Core package namespace
|
|
46
|
+
│ ├── main.py # CLI session manager (entrypoints: lm, lemonpie)
|
|
47
|
+
│ ├── config.py # Configuration logic & I/O
|
|
48
|
+
│ ├── paths.py # OS-appropriate config/data directory resolution
|
|
49
|
+
│ ├── model_utils.py # Model finding & resolution
|
|
50
|
+
│ ├── cli_utils.py # Terminal helpers & confirmation
|
|
51
|
+
│ ├── session_utils.py # Session persistence
|
|
52
|
+
│ ├── spinner.py # Status spinner
|
|
53
|
+
│ ├── time_utils.py # Timestamp helpers
|
|
54
|
+
│ └── cli/
|
|
55
|
+
│ └── config_cmd.py # Config manager (entrypoint: lmConfig)
|
|
56
|
+
├── config.example.json # Configuration template
|
|
57
|
+
├── pyproject.toml # Package & build configuration
|
|
58
|
+
├── README.md # Project overview
|
|
59
|
+
├── LICENSE # GPLv3 license
|
|
60
|
+
└── .gitignore
|
|
55
61
|
```
|
|
56
62
|
|
|
57
63
|
---
|
|
58
64
|
|
|
59
|
-
## ⚙️ Configuration
|
|
65
|
+
## ⚙️ Configuration
|
|
66
|
+
|
|
67
|
+
LemonPie keeps its config file and session history in your OS's standard user directories (via [`platformdirs`](https://pypi.org/project/platformdirs/)) — not in the project folder:
|
|
68
|
+
|
|
69
|
+
| | Linux | macOS | Windows |
|
|
70
|
+
|------------|---------------------------------|----------------------------------------------|------------------------------|
|
|
71
|
+
| Config | `~/.config/lemonpie/` | `~/Library/Application Support/lemonpie/` | `%LOCALAPPDATA%\lemonpie\` |
|
|
72
|
+
| Sessions | `~/.local/share/lemonpie/sessions/` | `~/Library/Application Support/lemonpie/sessions/` | `%LOCALAPPDATA%\lemonpie\sessions\` |
|
|
73
|
+
|
|
74
|
+
Both are overridable via environment variables — `LEMONPIE_CONFIG_DIR` and `LEMONPIE_SESSIONS_DIR` — useful for testing or running in a container.
|
|
75
|
+
|
|
76
|
+
`config.example.json` at the repo root is a template. `lmConfig` will create your real config file on first use if one doesn't exist yet.
|
|
77
|
+
|
|
60
78
|
### Example structure:
|
|
61
79
|
```json
|
|
62
80
|
{
|
|
@@ -77,7 +95,7 @@ models: list of objects with alias (nullable) and name
|
|
|
77
95
|
|
|
78
96
|
## 🚀 Usage
|
|
79
97
|
|
|
80
|
-
### lm
|
|
98
|
+
### `lm` / `lemonpie`
|
|
81
99
|
- Start a new session \
|
|
82
100
|
`lm -n "Hello"`
|
|
83
101
|
|
|
@@ -96,7 +114,7 @@ models: list of objects with alias (nullable) and name
|
|
|
96
114
|
- Switch model in current session\
|
|
97
115
|
`lm -m qwen2.5-coder:3b`
|
|
98
116
|
|
|
99
|
-
### lmConfig
|
|
117
|
+
### `lmConfig`
|
|
100
118
|
- Manage models with lmConfig\
|
|
101
119
|
`lmConfig --add-model qwen qwen2.5-coder:3b`\
|
|
102
120
|
`lmConfig --list-models`\
|
|
@@ -140,4 +158,3 @@ This project is licensed under the **GNU General Public License v3.0** (**GPLv3*
|
|
|
140
158
|
|
|
141
159
|
|
|
142
160
|
---
|
|
143
|
-
|
|
@@ -1,129 +1,144 @@
|
|
|
1
|
-
# LemonPie
|
|
2
|
-
|
|
3
|
-
**The ultra‑lightweight Ollama session manager for terminal workflows**
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
LemonPie is a compact CLI for interacting with an Ollama server. It manages chat sessions and persists history locally, designed to be tiny and portable — ideal for lightweight systems and terminal users, but usable anywhere with Python and network access.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## ✨ Features
|
|
13
|
-
- Start and manage chat sessions with Ollama models
|
|
14
|
-
- Persist session history
|
|
15
|
-
- Configure host, default model, and aliases via
|
|
16
|
-
- Add, remove, and list models with aliases (`lmConfig`)
|
|
17
|
-
- Switch models mid‑session with confirmation
|
|
18
|
-
- Atomic writes for safety (tmp + replace)
|
|
19
|
-
- Streaming responses from Ollama for real‑time output
|
|
20
|
-
- Graceful handling of Ctrl‑C interrupts
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## 📂 Project Structure
|
|
25
|
-
|
|
26
|
-
```text
|
|
27
|
-
|
|
28
|
-
├──
|
|
29
|
-
│
|
|
30
|
-
│
|
|
31
|
-
│
|
|
32
|
-
│
|
|
33
|
-
│
|
|
34
|
-
│
|
|
35
|
-
├──
|
|
36
|
-
├──
|
|
37
|
-
├──
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
`
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
1
|
+
# LemonPie
|
|
2
|
+
|
|
3
|
+
**The ultra‑lightweight Ollama session manager for terminal workflows**
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
LemonPie is a compact CLI for interacting with an Ollama server. It manages chat sessions and persists history locally, designed to be tiny and portable — ideal for lightweight systems and terminal users, but usable anywhere with Python and network access.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## ✨ Features
|
|
13
|
+
- Start and manage chat sessions with Ollama models
|
|
14
|
+
- Persist session history in your OS's standard user data directory
|
|
15
|
+
- Configure host, default model, and aliases via a config file in your OS's standard user config directory
|
|
16
|
+
- Add, remove, and list models with aliases (`lmConfig`)
|
|
17
|
+
- Switch models mid‑session with confirmation
|
|
18
|
+
- Atomic writes for safety (tmp + replace)
|
|
19
|
+
- Streaming responses from Ollama for real‑time output
|
|
20
|
+
- Graceful handling of Ctrl‑C interrupts
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 📂 Project Structure
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
LemonPie/
|
|
28
|
+
├── src/
|
|
29
|
+
│ └── lemonpie/ # Core package namespace
|
|
30
|
+
│ ├── main.py # CLI session manager (entrypoints: lm, lemonpie)
|
|
31
|
+
│ ├── config.py # Configuration logic & I/O
|
|
32
|
+
│ ├── paths.py # OS-appropriate config/data directory resolution
|
|
33
|
+
│ ├── model_utils.py # Model finding & resolution
|
|
34
|
+
│ ├── cli_utils.py # Terminal helpers & confirmation
|
|
35
|
+
│ ├── session_utils.py # Session persistence
|
|
36
|
+
│ ├── spinner.py # Status spinner
|
|
37
|
+
│ ├── time_utils.py # Timestamp helpers
|
|
38
|
+
│ └── cli/
|
|
39
|
+
│ └── config_cmd.py # Config manager (entrypoint: lmConfig)
|
|
40
|
+
├── config.example.json # Configuration template
|
|
41
|
+
├── pyproject.toml # Package & build configuration
|
|
42
|
+
├── README.md # Project overview
|
|
43
|
+
├── LICENSE # GPLv3 license
|
|
44
|
+
└── .gitignore
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## ⚙️ Configuration
|
|
50
|
+
|
|
51
|
+
LemonPie keeps its config file and session history in your OS's standard user directories (via [`platformdirs`](https://pypi.org/project/platformdirs/)) — not in the project folder:
|
|
52
|
+
|
|
53
|
+
| | Linux | macOS | Windows |
|
|
54
|
+
|------------|---------------------------------|----------------------------------------------|------------------------------|
|
|
55
|
+
| Config | `~/.config/lemonpie/` | `~/Library/Application Support/lemonpie/` | `%LOCALAPPDATA%\lemonpie\` |
|
|
56
|
+
| Sessions | `~/.local/share/lemonpie/sessions/` | `~/Library/Application Support/lemonpie/sessions/` | `%LOCALAPPDATA%\lemonpie\sessions\` |
|
|
57
|
+
|
|
58
|
+
Both are overridable via environment variables — `LEMONPIE_CONFIG_DIR` and `LEMONPIE_SESSIONS_DIR` — useful for testing or running in a container.
|
|
59
|
+
|
|
60
|
+
`config.example.json` at the repo root is a template. `lmConfig` will create your real config file on first use if one doesn't exist yet.
|
|
61
|
+
|
|
62
|
+
### Example structure:
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"server": "http://127.0.0.1:11434",
|
|
66
|
+
"default": "qwen2.5-coder:3b",
|
|
67
|
+
"models": [
|
|
68
|
+
{ "alias": "qwen", "name": "qwen2.5-coder:3b" },
|
|
69
|
+
{ "alias": null, "name": "qwen2.5-coder:1.5b-base" }
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
server: Ollama host URL\
|
|
74
|
+
default: canonical model name (full identifier)\
|
|
75
|
+
models: list of objects with alias (nullable) and name
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 🚀 Usage
|
|
81
|
+
|
|
82
|
+
### `lm` / `lemonpie`
|
|
83
|
+
- Start a new session \
|
|
84
|
+
`lm -n "Hello"`
|
|
85
|
+
|
|
86
|
+
- Start with a specific model\
|
|
87
|
+
`lm -n -m qwen "Hello"`
|
|
88
|
+
|
|
89
|
+
- Send a prompt to the current session\
|
|
90
|
+
`lm "Tell me about git add"`
|
|
91
|
+
|
|
92
|
+
- List sessions\
|
|
93
|
+
`lm -l`
|
|
94
|
+
|
|
95
|
+
- Print current session history\
|
|
96
|
+
`lm -p`
|
|
97
|
+
|
|
98
|
+
- Switch model in current session\
|
|
99
|
+
`lm -m qwen2.5-coder:3b`
|
|
100
|
+
|
|
101
|
+
### `lmConfig`
|
|
102
|
+
- Manage models with lmConfig\
|
|
103
|
+
`lmConfig --add-model qwen qwen2.5-coder:3b`\
|
|
104
|
+
`lmConfig --list-models`\
|
|
105
|
+
`lmConfig --remove-model qwen`
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
## 🗺 Roadmap
|
|
109
|
+
|
|
110
|
+
Planned features and improvements:
|
|
111
|
+
|
|
112
|
+
- `lmConfig --init`
|
|
113
|
+
Interactive setup command that:
|
|
114
|
+
- Prompts for Ollama server IP:port
|
|
115
|
+
- Verifies server reachability
|
|
116
|
+
- Lists available models if server responds
|
|
117
|
+
- Allows user to select models to add
|
|
118
|
+
- Handles cases where no models are found (with guidance to Ollama docs)
|
|
119
|
+
- Supports `--force` to override verification or alias conflicts
|
|
120
|
+
|
|
121
|
+
- Model verification state machine
|
|
122
|
+
Planned logic for `lmConfig --add-model`:
|
|
123
|
+
- Check server reachability
|
|
124
|
+
- Verify if model is installed
|
|
125
|
+
- Offer to pull missing models
|
|
126
|
+
- Handle pull success/failure and user choice
|
|
127
|
+
- Respect `--force` for overriding conflicts or skipping checks
|
|
128
|
+
*(See docs/design/state-machine.md for full diagram once published)*
|
|
129
|
+
|
|
130
|
+
- Enhanced error handling and user feedback
|
|
131
|
+
- Graceful handling of server errors (HTTP codes, non‑JSON responses)
|
|
132
|
+
|
|
133
|
+
- Packaging for Debian (`.deb` via apt)
|
|
134
|
+
- Future schema validation for config/session files
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 📜 License
|
|
140
|
+
|
|
141
|
+
This project is licensed under the **GNU General Public License v3.0** (**GPLv3**).You may redistribute and/or modify it under the terms of the GPL as published by the Free Software Foundation.See the [**license**](LICENSE) file for details.
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
---
|
|
@@ -11,10 +11,12 @@ authors = [
|
|
|
11
11
|
]
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
license = "GPL-3.0-or-later"
|
|
14
|
-
requires-python = ">=3.
|
|
14
|
+
requires-python = ">=3.11"
|
|
15
15
|
|
|
16
16
|
dependencies = [
|
|
17
|
-
"ollama"
|
|
17
|
+
"ollama",
|
|
18
|
+
"httpx",
|
|
19
|
+
"platformdirs"
|
|
18
20
|
]
|
|
19
21
|
|
|
20
22
|
[project.urls]
|
|
@@ -23,12 +25,15 @@ repository = "https://github.com/famousStratum/LemonPie"
|
|
|
23
25
|
issues = "https://github.com/famousStratum/LemonPie/issues"
|
|
24
26
|
|
|
25
27
|
[project.scripts]
|
|
26
|
-
lm = "lemonpie.
|
|
27
|
-
lemonpie = "lemonpie.
|
|
28
|
-
lmConfig = "lemonpie.
|
|
28
|
+
lm = "lemonpie.main:main"
|
|
29
|
+
lemonpie = "lemonpie.main:main"
|
|
30
|
+
lmConfig = "lemonpie.cli.config_cmd:main"
|
|
29
31
|
|
|
30
32
|
[tool.hatch.version]
|
|
31
33
|
source = "vcs"
|
|
32
34
|
|
|
33
35
|
[tool.hatch.build.hooks.vcs]
|
|
34
|
-
version-file = "lemonpie/_version.py"
|
|
36
|
+
version-file = "src/lemonpie/_version.py"
|
|
37
|
+
|
|
38
|
+
[tool.hatch.build.targets.wheel]
|
|
39
|
+
packages = ["src/lemonpie"]
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.
|
|
22
|
-
__version_tuple__ = version_tuple = (0,
|
|
21
|
+
__version__ = version = '0.2.0a1'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 2, 0, 'a1')
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from platformdirs import user_config_dir, user_data_dir
|
|
3
|
+
|
|
4
|
+
APP_NAME = "lemonpie"
|
|
5
|
+
|
|
6
|
+
# Config directory: OS-appropriate user config location
|
|
7
|
+
# (~/.config/lemonpie, %LOCALAPPDATA%\lemonpie, ~/Library/Application Support/lemonpie).
|
|
8
|
+
# Override with $LEMONPIE_CONFIG_DIR.
|
|
9
|
+
CONFIG_DIR = os.environ.get(
|
|
10
|
+
"LEMONPIE_CONFIG_DIR",
|
|
11
|
+
user_config_dir(APP_NAME, appauthor=False)
|
|
12
|
+
)
|
|
13
|
+
os.makedirs(CONFIG_DIR, exist_ok=True)
|
|
14
|
+
|
|
15
|
+
CONFIG_FILE = os.path.join(CONFIG_DIR, "config.json")
|
|
16
|
+
|
|
17
|
+
# Sessions directory: OS-appropriate user data location, with precedence given
|
|
18
|
+
# to $LEMONPIE_SESSIONS_DIR for backward compatibility / testing / containers.
|
|
19
|
+
DATA_DIR = user_data_dir(APP_NAME, appauthor=False)
|
|
20
|
+
SESSIONS_DIR = os.environ.get(
|
|
21
|
+
"LEMONPIE_SESSIONS_DIR",
|
|
22
|
+
os.path.join(DATA_DIR, "sessions")
|
|
23
|
+
)
|
|
24
|
+
os.makedirs(SESSIONS_DIR, exist_ok=True)
|
|
25
|
+
|
|
26
|
+
CURRENT_FILE = os.path.join(SESSIONS_DIR, ".current")
|