Skip to content

Commit

Permalink
Added debug run
Browse files Browse the repository at this point in the history
  • Loading branch information
Psychokiller1888 committed Dec 8, 2021
1 parent de455e3 commit eb04076
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions AliceCli/AliceCli.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def cli(ctx: click.Context):
cli.add_command(utils.changePassword)
cli.add_command(alice.updateAlice)
cli.add_command(alice.systemctl)
cli.add_command(alice.reportBug)
cli.add_command(install.installAlice)
cli.add_command(install.installSoundDevice)
cli.add_command(install.uninstallSoundDevice)
Expand Down
8 changes: 6 additions & 2 deletions AliceCli/MainMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
#
# Last modified: 2021.03.07 at 10:56:35 CET
# Last modified by: Psycho
import click
import re
import subprocess
import sys

import click
from PyInquirer import Separator, prompt

from AliceCli.Version import Version
from AliceCli.alice.alice import systemctl, updateAlice
from AliceCli.alice.alice import reportBug, systemctl, updateAlice
from AliceCli.install.install import installAlice, installSoundDevice, prepareSdCard, uninstallSoundDevice
from AliceCli.utils.commons import connect, discover
from AliceCli.utils.utils import aliceLogs, changeHostname, changePassword, reboot, soundTest, systemLogs, updateSystem, upgradeSystem
Expand Down Expand Up @@ -94,6 +95,7 @@ def mainMenu(ctx: click.Context):
'Upgrade system',
'Reboot device',
'Uninstall your sound device',
'Enable bug report for next session',
'Check Alice logs',
'Check system logs',
'Exit'
Expand Down Expand Up @@ -147,5 +149,7 @@ def mainMenu(ctx: click.Context):
ctx.invoke(aliceLogs)
elif answers['mainMenu'] == 'Check system logs':
ctx.invoke(systemLogs)
elif answers['mainMenu'] == 'Enable bug report for next session':
ctx.invoke(reportBug)
else:
ctx.invoke(mainMenu)
15 changes: 15 additions & 0 deletions AliceCli/alice/alice.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,18 @@ def systemctl(ctx: click.Context, option: str):

commons.printSuccess('Done!')
commons.returnToMainMenu(ctx, pause=True)


@click.command(name='reportBug')
@click.pass_context
@checkConnection
def reportBug(ctx: click.Context):
click.secho('Enabling inbuilt bug reporter', color='yellow')

commons.waitAnimation()
commons.SSH.exec_command('touch ~/ProjectAlice/alice.bugreport')
click.secho('Restarting Alice', color='yellow')
commons.SSH.exec_command('sudo systemctl restart ProjectAlice')

commons.printSuccess('Bug reporter enabled and Alice restart. As soon as a fatal error occurs and/or she is stopped, the session report will be posted to Github!')
commons.returnToMainMenu(ctx, pause=True)
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
# Last modified by: Psycho

from pathlib import Path

from setuptools import find_packages, setup


setup(
name='projectalice-cli',
version='0.2.4',
version='0.2.5',
long_description=Path('README.md').read_text(encoding='utf8'),
long_description_content_type='text/markdown',
python_requires='>=3.8',
Expand Down

0 comments on commit eb04076

Please sign in to comment.