Skip to content

Commit c7303cd

Browse files
committed
Quick fix for 0.2.1
1 parent 5866c5d commit c7303cd

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

com.jeffser.Alpaca.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
{
6666
"type" : "git",
6767
"url" : "https://github.com/Jeffser/Alpaca.git",
68-
"tag": "0.2.0"
68+
"tag": "0.2.1"
6969
}
7070
]
7171
}

data/com.jeffser.Alpaca.metainfo.xml.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@
5151
<url type="homepage">https://github.com/Jeffser/Alpaca</url>
5252
<url type="donation">https://github.com/sponsors/Jeffser</url>
5353
<releases>
54+
<release version="0.2.1" date="2024-05-14">
55+
<url type="details">https://github.com/Jeffser/Alpaca/releases/tag/0.2.1</url>
56+
<description>
57+
<p>0.2.1 Data saving fix</p>
58+
<p>The app didn't save the config files and chat history to the right directory, this is now fixed</p>
59+
<p>
60+
Please report any errors to the issues page, thank you.
61+
</p>
62+
</description>
63+
</release>
5464
<release version="0.2.0" date="2024-05-14">
5565
<url type="details">https://github.com/Jeffser/Alpaca/releases/tag/0.2.0</url>
5666
<description>

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project('Alpaca',
2-
version: '0.2.0',
2+
version: '0.2.1',
33
meson_version: '>= 0.62.0',
44
default_options: [ 'warning_level=2', 'werror=false', ],
55
)

src/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def on_about_action(self, widget, _):
4848
application_name='Alpaca',
4949
application_icon='com.jeffser.Alpaca',
5050
developer_name='Jeffry Samuel Eduarte Rojas',
51-
version='0.2.0',
51+
version='0.2.1',
5252
developers=['Jeffser https://jeffser.com'],
5353
designers=['Jeffser https://jeffser.com'],
5454
copyright='© 2024 Jeffser',

src/window.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
@Gtk.Template(resource_path='/com/jeffser/Alpaca/window.ui')
2929
class AlpacaWindow(Adw.ApplicationWindow):
30+
config_dir = os.path.join(os.getenv("XDG_CONFIG_HOME"), "/", os.path.expanduser("~/.var/app/com.jeffser.Alpaca/config"))
3031
__gtype_name__ = 'AlpacaWindow'
31-
3232
#Variables
3333
ollama_url = None
3434
local_models = []
@@ -106,7 +106,7 @@ def verify_connection(self):
106106
response = simple_get(self.ollama_url)
107107
if response['status'] == 'ok':
108108
if "Ollama is running" in response['text']:
109-
with open("server.conf", "w+") as f: f.write(self.ollama_url)
109+
with open(os.path.join(self.config_dir, "server.conf"), "w+") as f: f.write(self.ollama_url)
110110
self.message_entry.grab_focus_without_selecting()
111111
self.update_list_local_models()
112112
return True
@@ -320,14 +320,14 @@ def clear_conversation_dialog(self):
320320
)
321321

322322
def save_history(self):
323-
with open("chats.json", "w+") as f:
323+
with open(os.path.join(self.config_dir, "chats.json"), "w+") as f:
324324
json.dump(self.chats, f, indent=4)
325325

326326
def load_history(self):
327-
if os.path.exists("chats.json"):
327+
if os.path.exists(os.path.join(self.config_dir, "chats.json")):
328328
self.clear_conversation()
329329
try:
330-
with open("chats.json", "r") as f:
330+
with open(os.path.join(self.config_dir, "chats.json"), "r") as f:
331331
self.chats = json.load(f)
332332
except Exception as e:
333333
self.chats = {"chats": {"0": {"messages": []}}}
@@ -350,8 +350,8 @@ def __init__(self, **kwargs):
350350
self.connection_url_entry.connect("changed", lambda entry: entry.set_css_classes([]))
351351
self.connection_dialog.connect("close-attempt", lambda dialog: self.destroy())
352352
self.load_history()
353-
if os.path.exists("server.conf"):
354-
with open("server.conf", "r") as f:
353+
if os.path.exists(os.path.join(self.config_dir, "server.conf")):
354+
with open(os.path.join(self.config_dir, "server.conf"), "r") as f:
355355
self.ollama_url = f.read()
356356
if self.verify_connection() is False: self.show_connection_dialog()
357357
else: self.connection_dialog.present(self)

0 commit comments

Comments
 (0)