Skip to content

Commit

Permalink
Preparing for 0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffser committed May 30, 2024
1 parent c994307 commit 4b17601
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 28 deletions.
25 changes: 25 additions & 0 deletions com.jeffser.Alpaca.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,31 @@
}
]
},
{
"name": "ollama",
"buildsystem": "simple",
"build-commands": [
"install -Dm0755 ollama* ${FLATPAK_DEST}/bin/ollama"
],
"sources": [
{
"type": "file",
"url": "https://github.com/ollama/ollama/releases/download/v0.1.38/ollama-linux-amd64",
"sha256": "c3360812503a9756a507ebb9d78667e2b21800a760b45046bc48a8f3b81972f4",
"only-arches": [
"x86_64"
]
},
{
"type": "file",
"url": "https://github.com/ollama/ollama/releases/download/v0.1.38/ollama-linux-arm64",
"sha256": "f2d091afe665b2d5ba8b68e2473d36cdfaf80c61c7d2844a0a8f533c4e62f547",
"only-arches": [
"aarch64"
]
}
]
},
{
"name" : "alpaca",
"builddir" : true,
Expand Down
9 changes: 9 additions & 0 deletions data/com.jeffser.Alpaca.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@
<url type="homepage">https://github.com/Jeffser/Alpaca</url>
<url type="donation">https://github.com/sponsors/Jeffser</url>
<releases>
<release version="0.9.2" date="2024-05-30">
<url type="details">https://github.com/Jeffser/Alpaca/releases/tag/0.9.2</url>
<description>
<p>Fix</p>
<ul>
<li>Fixed: app didn't open if models tweaks wasn't present in the config files</li>
</ul>
</description>
</release>
<release version="0.9.1" date="2024-05-29">
<url type="details">https://github.com/Jeffser/Alpaca/releases/tag/0.9.1</url>
<description>
Expand Down
36 changes: 18 additions & 18 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ test('Validate schema file',
compile_schemas,
args: ['--strict', '--dry-run', meson.current_source_dir()])

service_conf = configuration_data()
service_conf.set('appid', application_id)
service_conf.set('libexecdir', join_paths(get_option('prefix'), get_option('bindir')))
configure_file(
input: 'com.jeffser.Alpaca.SearchProvider.service.in',
output: '@[email protected]'.format(application_id),
configuration: service_conf,
install_dir: join_paths(join_paths(get_option('prefix'), get_option('datadir')), 'dbus-1', 'services')
)

search_provider_conf = configuration_data()
search_provider_conf.set('appid', application_id)
configure_file(
configuration: search_provider_conf,
input: files('com.jeffser.Alpaca.SearchProvider.ini.in'),
install_dir: join_paths(get_option('datadir'), 'gnome-shell', 'search-providers'),
output: '@[email protected]'.format(application_id)
)
#service_conf = configuration_data()
#service_conf.set('appid', application_id)
#service_conf.set('libexecdir', join_paths(get_option('prefix'), get_option('bindir')))
#configure_file(
#input: 'com.jeffser.Alpaca.SearchProvider.service.in',
#output: '@[email protected]'.format(application_id),
#configuration: service_conf,
#install_dir: join_paths(join_paths(get_option('prefix'), get_option('datadir')), 'dbus-1', 'services')
#)

#search_provider_conf = configuration_data()
#search_provider_conf.set('appid', application_id)
#configure_file(
#configuration: search_provider_conf,
#input: files('com.jeffser.Alpaca.SearchProvider.ini.in'),
#install_dir: join_paths(get_option('datadir'), 'gnome-shell', 'search-providers'),
#output: '@[email protected]'.format(application_id)
#)


subdir('icons')
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('Alpaca', 'c',
version: '0.9.1',
version: '0.9.2',
meson_version: '>= 0.62.0',
default_options: [ 'warning_level=2', 'werror=false', ],
)
Expand Down
31 changes: 23 additions & 8 deletions src/alpaca_search_provider.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ class SearchProvider:
def __init__(self):
print("ALPACA __init__")
self.connection = Gio.bus_get_sync(Gio.BusType.SESSION, None)
self.connection.register_object(DBUS_OBJECT_PATH, self.get_interface_info(), None, self.handle_method_call, None)
if not self.connection:
print("ALPACA Failed to get D-Bus connection")
return

print("ALPACA D-Bus connection obtained")

interface_info = self.get_interface_info()
self.registration_id = self.connection.register_object(DBUS_OBJECT_PATH, interface_info, self.handle_method_call, None)

if self.registration_id > 0:
print(f"ALPACA Object registered with ID: {self.registration_id}")
else:
print("ALPACA Failed to register object")

def get_interface_info(self):
print("ALPACA get_interface_info")
Expand Down Expand Up @@ -56,19 +68,19 @@ class SearchProvider:
print("ALPACA handle_get_initial_result_set")
terms = parameters.unpack()[0]
print(f"Initial search terms: {terms}")
results = []
results = ["result1", "result2"]
if "Alpaca" in terms:
results.append("placeholder_result")
results.append("alpaca_placeholder_result")
print(f"Returning results: {results}")
invocation.return_value(GLib.Variant("(as)", [results]))

def handle_get_subsearch_result_set(self, invocation, parameters):
print("ALPACA handle_get_subsearch_result_set")
previous_results, terms = parameters.unpack()
print(f"Subsearch terms: {terms}, previous results: {previous_results}")
results = []
results = ["result3", "result4"]
if "Alpaca" in terms:
results.append("sub_placeholder_result")
results.append("sub_alpaca_placeholder_result")
print(f"Returning subsearch results: {results}")
invocation.return_value(GLib.Variant("(as)", [results]))

Expand All @@ -91,6 +103,9 @@ class SearchProvider:

if __name__ == "__main__":
provider = SearchProvider()
loop = GLib.MainLoop()
loop.run()

if provider.registration_id > 0:
loop = GLib.MainLoop()
print("ALPACA Running main loop")
loop.run()
else:
print("ALPACA Failed to start main loop due to object registration failure")
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def on_about_action(self, widget, _):
application_name='Alpaca',
application_icon='com.jeffser.Alpaca',
developer_name='Jeffry Samuel Eduarte Rojas',
version='0.9.1',
version='0.9.2',
developers=['Jeffser https://jeffser.com'],
designers=['Jeffser https://jeffser.com'],
translator_credits='Alex K (Russian) https://github.com/alexkdeveloper\nJeffser (Spanish) https://jeffser.com\nDaimar Stein (Brazilian Portuguese) https://github.com/not-a-dev-stein\nLouis Chauvet-Villaret (French) https://github.com/loulou64490',
Expand Down

0 comments on commit 4b17601

Please sign in to comment.