-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Campaign to Save the CLI #161
Merged
Merged
Changes from 2 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d1b8c59
Fix #128.
thw26 5908cdd
add FIXME
n8marti f92d531
fix typo blocking selection of wine binary
n8marti 5d3774c
add "choose default with Enter" feature
n8marti 2f0b0ff
fix crazy slow MD5 sum calculation
n8marti b43e6dc
use separate events for input_q and choice_q
n8marti c918db5
initial work for --run-installed-app
n8marti 8a82699
additional TODOs, etc.
n8marti 1008fc5
minor CLI fixes
n8marti b63ed02
fix incorrect setting of config.DIALOG as 'cli' when using other DIALOGs
n8marti 075da8f
add TODO
n8marti aa8fc02
use single func wine.wineserver_wait; log if procs still using WINEPR…
n8marti 11315d1
only kill wine procs in close func if exiting from Control Panel
n8marti b3fce6e
fix --set-appimage CLI subcommand
n8marti 0814ecd
update list of subcommands that assume Logos is already installed
n8marti 96280de
convert all actions to cli app methods
n8marti a28a838
add TODO
n8marti f71731e
add TODO
n8marti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import logging | ||
import threading | ||
import queue | ||
|
||
import config | ||
import installer | ||
import msg | ||
import utils | ||
|
||
|
||
class CLI: | ||
def __init__(self): | ||
self.running = True | ||
self.choice_q = queue.Queue() | ||
self.input_q = queue.Queue() | ||
self.event = threading.Event() | ||
|
||
def stop(self): | ||
self.running = False | ||
|
||
def run(self): | ||
config.DIALOG = "cli" | ||
|
||
self.thread = utils.start_thread(installer.ensure_launcher_shortcuts, daemon_bool=True, app=self) | ||
|
||
while self.running: | ||
self.user_input_processor() | ||
|
||
msg.logos_msg("Exiting CLI installer.") | ||
|
||
|
||
def user_input_processor(self): | ||
prompt = None | ||
question = None | ||
options = None | ||
choice = None | ||
if self.input_q.qsize() > 0: | ||
prompt = self.input_q.get() | ||
if prompt is not None and isinstance(prompt, tuple): | ||
question = prompt[0] | ||
options = prompt[1] | ||
if question is not None and options is not None: | ||
choice = input(f"{question}: {options}: ") | ||
if choice is not None and choice.lower() == 'exit': | ||
self.running = False | ||
if choice is not None: | ||
self.choice_q.put(choice) | ||
self.event.set() | ||
|
||
|
||
def command_line_interface(): | ||
CLI().run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed in #182