Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
szczyglis-dev committed Apr 16, 2023
1 parent acf910d commit 2c49207
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/pygpt_net/core/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,4 +499,3 @@ def deserialize(self, data):
def dump(self):
"""Dumps item to string"""
return json.dumps(self.serialize())

2 changes: 1 addition & 1 deletion src/pygpt_net/core/controller/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ def update_menu(self):
if self.window.controller.plugins.is_enabled('audio_azure'):
self.window.menu['audio.output'].setChecked(True)
else:
self.window.menu['audio.output'].setChecked(False)
self.window.menu['audio.output'].setChecked(False)
3 changes: 2 additions & 1 deletion src/pygpt_net/core/plugin/self_loop/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def on_ctx_end(self, ctx):
if iterations == 0 or self.iteration < iterations:
self.iteration += 1
if self.prev_output is not None and self.prev_output != "":
self.window.log("Plugin: self_loop:on_ctx_end [sending prev_output...]: {}".format(self.prev_output)) # log
self.window.log(
"Plugin: self_loop:on_ctx_end [sending prev_output...]: {}".format(self.prev_output)) # log
self.window.controller.input.send(self.prev_output)
return ctx

Expand Down
10 changes: 5 additions & 5 deletions src/pygpt_net/core/plugin/web_search/websearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ def google_search(self, q, num):
urls = []
try:
url = 'https://www.googleapis.com/customsearch/v1'
url += '?key='+str(key)
url += '&cx='+str(cx)
url += '&num='+str(num)
url += '?key=' + str(key)
url += '&cx=' + str(cx)
url += '&num=' + str(num)
url += '&sort=date-sdate:d:s'
url += '&fields=items(link)'
url += '&q=' + quote(q)
Expand Down Expand Up @@ -132,7 +132,8 @@ def query_web(self, string):
self.plugin.window.log("Plugin: web_search:query_web [crawled content]: {}".format(content)) # log

if content is not None:
self.plugin.window.log("Plugin: web_search:query_web [content length]: {}".format(len(content))) # log
self.plugin.window.log(
"Plugin: web_search:query_web [content length]: {}".format(len(content))) # log

# if Google is disabled, use Wikipedia
if len(pages) == 0:
Expand Down Expand Up @@ -276,4 +277,3 @@ def get_system_prompt(self, question, prompt):
"Plugin: web_search:get_system_prompt [prompt length]: {}".format(len(prompt))) # log

return prompt

2 changes: 1 addition & 1 deletion src/pygpt_net/core/ui/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def setup_plugins(self):
def setup_audio(self):
"""Setups audio menu"""
self.window.menu['audio.output'] = QAction(trans("menu.audio.output"),
self.window, checkable=True)
self.window, checkable=True)

self.window.menu['audio.output'].triggered.connect(
lambda: self.window.controller.plugins.toggle('audio_azure'))
Expand Down

0 comments on commit 2c49207

Please sign in to comment.