diff --git a/com.jeffser.Alpaca.json b/com.jeffser.Alpaca.json index 6edd7e1..739646c 100644 --- a/com.jeffser.Alpaca.json +++ b/com.jeffser.Alpaca.json @@ -65,7 +65,7 @@ { "type" : "git", "url" : "https://github.com/Jeffser/Alpaca.git", - "tag": "0.2.0" + "tag": "0.2.1" } ] } diff --git a/data/com.jeffser.Alpaca.metainfo.xml.in b/data/com.jeffser.Alpaca.metainfo.xml.in index e166489..4f9e507 100644 --- a/data/com.jeffser.Alpaca.metainfo.xml.in +++ b/data/com.jeffser.Alpaca.metainfo.xml.in @@ -51,6 +51,16 @@ https://github.com/Jeffser/Alpaca https://github.com/sponsors/Jeffser + + https://github.com/Jeffser/Alpaca/releases/tag/0.2.1 + + 0.2.1 Data saving fix + The app didn't save the config files and chat history to the right directory, this is now fixed + + Please report any errors to the issues page, thank you. + + + https://github.com/Jeffser/Alpaca/releases/tag/0.2.0 diff --git a/meson.build b/meson.build index 9005ef1..fb3b320 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('Alpaca', - version: '0.2.0', + version: '0.2.1', meson_version: '>= 0.62.0', default_options: [ 'warning_level=2', 'werror=false', ], ) diff --git a/src/main.py b/src/main.py index a9c3036..66ed1e8 100644 --- a/src/main.py +++ b/src/main.py @@ -48,7 +48,7 @@ class AlpacaApplication(Adw.Application): application_name='Alpaca', application_icon='com.jeffser.Alpaca', developer_name='Jeffry Samuel Eduarte Rojas', - version='0.2.0', + version='0.2.1', developers=['Jeffser https://jeffser.com'], designers=['Jeffser https://jeffser.com'], copyright='© 2024 Jeffser', diff --git a/src/window.py b/src/window.py index 8759cab..6e143f3 100644 --- a/src/window.py +++ b/src/window.py @@ -27,8 +27,8 @@ from .available_models import available_models @Gtk.Template(resource_path='/com/jeffser/Alpaca/window.ui') class AlpacaWindow(Adw.ApplicationWindow): + config_dir = os.path.join(os.getenv("XDG_CONFIG_HOME"), "/", os.path.expanduser("~/.var/app/com.jeffser.Alpaca/config")) __gtype_name__ = 'AlpacaWindow' - #Variables ollama_url = None local_models = [] @@ -106,7 +106,7 @@ class AlpacaWindow(Adw.ApplicationWindow): response = simple_get(self.ollama_url) if response['status'] == 'ok': if "Ollama is running" in response['text']: - with open("server.conf", "w+") as f: f.write(self.ollama_url) + with open(os.path.join(self.config_dir, "server.conf"), "w+") as f: f.write(self.ollama_url) self.message_entry.grab_focus_without_selecting() self.update_list_local_models() return True @@ -320,14 +320,14 @@ class AlpacaWindow(Adw.ApplicationWindow): ) def save_history(self): - with open("chats.json", "w+") as f: + with open(os.path.join(self.config_dir, "chats.json"), "w+") as f: json.dump(self.chats, f, indent=4) def load_history(self): - if os.path.exists("chats.json"): + if os.path.exists(os.path.join(self.config_dir, "chats.json")): self.clear_conversation() try: - with open("chats.json", "r") as f: + with open(os.path.join(self.config_dir, "chats.json"), "r") as f: self.chats = json.load(f) except Exception as e: self.chats = {"chats": {"0": {"messages": []}}} @@ -350,8 +350,8 @@ class AlpacaWindow(Adw.ApplicationWindow): self.connection_url_entry.connect("changed", lambda entry: entry.set_css_classes([])) self.connection_dialog.connect("close-attempt", lambda dialog: self.destroy()) self.load_history() - if os.path.exists("server.conf"): - with open("server.conf", "r") as f: + if os.path.exists(os.path.join(self.config_dir, "server.conf")): + with open(os.path.join(self.config_dir, "server.conf"), "r") as f: self.ollama_url = f.read() if self.verify_connection() is False: self.show_connection_dialog() else: self.connection_dialog.present(self)
0.2.1 Data saving fix
The app didn't save the config files and chat history to the right directory, this is now fixed
+ Please report any errors to the issues page, thank you. +