Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
054ed9188d
|
|||
968b3e3db9
|
|||
421f161ddd
|
|||
cfdf60d840
|
@ -39,6 +39,9 @@
|
|||||||
"name" : "imaginer",
|
"name" : "imaginer",
|
||||||
"builddir" : true,
|
"builddir" : true,
|
||||||
"buildsystem" : "meson",
|
"buildsystem" : "meson",
|
||||||
|
"config-opts": [
|
||||||
|
"-Dbuildtype=release"
|
||||||
|
],
|
||||||
"sources" : [
|
"sources" : [
|
||||||
{
|
{
|
||||||
"type" : "dir",
|
"type" : "dir",
|
||||||
|
@ -52,6 +52,22 @@
|
|||||||
</keywords>
|
</keywords>
|
||||||
|
|
||||||
<releases>
|
<releases>
|
||||||
|
<release version="0.1.2" date="2023-5-3" type="stable">
|
||||||
|
<description>
|
||||||
|
<p>Appdata sorting</p>
|
||||||
|
<ul>
|
||||||
|
<li>Sort appdata releases</li>
|
||||||
|
</ul>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release version="0.1.1" date="2023-5-3" type="stable">
|
||||||
|
<description>
|
||||||
|
<p>Bug fixes</p>
|
||||||
|
<ul>
|
||||||
|
<li>Fix a bug causing the app to crash when the path is not selected</li>
|
||||||
|
</ul>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
<release version="0.1.0" date="2023-5-3" type="stable">
|
<release version="0.1.0" date="2023-5-3" type="stable">
|
||||||
<description>
|
<description>
|
||||||
<p>Imagine with AI</p>
|
<p>Imagine with AI</p>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
project('imaginer',
|
project('imaginer',
|
||||||
version: '0.1.0',
|
version: '0.1.2',
|
||||||
meson_version: '>= 0.62.0',
|
meson_version: '>= 0.62.0',
|
||||||
default_options: [ 'warning_level=2', 'werror=false', ],
|
default_options: [ 'warning_level=2', 'werror=false', ],
|
||||||
)
|
)
|
||||||
|
18
src/main.py
18
src/main.py
@ -156,14 +156,16 @@ class ImaginerApplication(Adw.Application):
|
|||||||
self.token = self.win.token.get_text()
|
self.token = self.win.token.get_text()
|
||||||
openai.api_key = self.token
|
openai.api_key = self.token
|
||||||
|
|
||||||
try:
|
|
||||||
path = self.file_path
|
|
||||||
print(path)
|
|
||||||
path = f"{path}/imaginer-{self.slugify(prompt)}-{strftime('%d-%b-%Y-%H-%M-%S', gmtime())}"
|
|
||||||
except AttributeError:
|
|
||||||
path = "imaginer"
|
|
||||||
|
|
||||||
def thread_run():
|
def thread_run():
|
||||||
|
try:
|
||||||
|
path = self.file_path
|
||||||
|
print(path)
|
||||||
|
except AttributeError:
|
||||||
|
path = "imaginer"
|
||||||
|
else:
|
||||||
|
path = f"{path}/imaginer-{self.slugify(prompt)}-{strftime('%d-%b-%Y-%H-%M-%S', gmtime())}"
|
||||||
|
|
||||||
match self.provider:
|
match self.provider:
|
||||||
case ProvidersEnum.OPENAI.value:
|
case ProvidersEnum.OPENAI.value:
|
||||||
try:
|
try:
|
||||||
@ -236,9 +238,9 @@ class ImaginerApplication(Adw.Application):
|
|||||||
else:
|
else:
|
||||||
image = None
|
image = None
|
||||||
|
|
||||||
GLib.idle_add(cleanup, image)
|
GLib.idle_add(cleanup, image, path)
|
||||||
|
|
||||||
def cleanup(image):
|
def cleanup(image, path):
|
||||||
self.win.spinner_loading.stop()
|
self.win.spinner_loading.stop()
|
||||||
self.win.stack_imaginer.set_visible_child_name("stack_imagine")
|
self.win.stack_imaginer.set_visible_child_name("stack_imagine")
|
||||||
t.join()
|
t.join()
|
||||||
|
Reference in New Issue
Block a user