Skip to content

Commit

Permalink
Fix for showing keys (on "install") (#56)
Browse files Browse the repository at this point in the history
* fix logging error

* fix keys GUI in FriendsOfGalaxy build structure

* open webbrowser as fallback

* add plugin installation source in bug template

* add both paths always
  • Loading branch information
UncleGoogle authored Nov 21, 2019
1 parent d8c678b commit 27bfa26
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ A clear and concise description of what the bug is. Provide steps to reproduce.
**Expected behavior**
A clear and concise description of what you expected to happen.

**Plugin installed**
directly from Galaxy / manually from your repository releases

**Provide logs**
- make reproduction steps you described above (tip: _cogwheel menu -> Sync Integration_ refreshes owned and local games)
- go to logs location:
Expand Down
4 changes: 3 additions & 1 deletion src/keysgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import sys
from typing import Optional

sys.path.insert(0, str(pathlib.PurePath(__file__).parent / 'modules'))
modules = pathlib.Path(__file__).parent / 'modules'
sys.path.insert(0, str(modules))
sys.path.insert(0, str(modules.parent)) # FriendsOfGalaxy structure

import toga

Expand Down
5 changes: 3 additions & 2 deletions src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ async def install_game(self, game_id):
process = await asyncio.create_subprocess_exec(sys.executable, *args, stderr=asyncio.subprocess.PIPE)
_, stderr_data = await process.communicate()
if stderr_data:
logging.error(f'Error for keygui: stderr_data', extra=args)
logging.error(f'Error for keygui: {stderr_data}', extra={'guiargs': args[:-1]})
webbrowser.open('https://www.humblebundle.com/home/keys') # fallback to browser
return

chosen_download = self._download_resolver(game)
Expand All @@ -158,7 +159,7 @@ async def install_game(self, game_id):
url = await self._api.get_trove_sign_url(chosen_download, game.machine_name)
except AuthenticationRequired:
logging.info('Looks like your Humble Monthly subscription has expired. Refer to config.ini to manage showed games.')
webbrowser.open('https://www.humblebundle.com/monthly/subscriber')
webbrowser.open('https://www.humblebundle.com/subscription/home')
else:
webbrowser.open(url['signed_url'])

Expand Down

0 comments on commit 27bfa26

Please sign in to comment.