Skip to content

Commit

Permalink
🚀🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum-quirks committed Jun 12, 2022
1 parent cf5f577 commit 5895fe1
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/quo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ def print(
from quo.i_o.termui import confirm, echo
from quo.shortcuts.utils import container

__version__ = "2022.5.3"
__version__ = "2022.6"
19 changes: 10 additions & 9 deletions src/quo/clipboard/pyperclip.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@

from .core import Clipboard, Data

try:
import pyperclip
#try:
# import pyperclip

except ModuleNotFoundError:
import os
os.system("pip install -U pyperclip")
#except ModuleNotFoundError:
# import os
# os.system("pip install -U pyperclip")

__all__ = [
#__all__ = [
"PyperclipClipboard",
]
#]

# We will be deprecating this in the later versions..

class PyperClipboard(Clipboard):
"""
Expand All @@ -27,10 +28,10 @@ def __init__(self) -> None:

def set_data(self, data: Data) -> None:
self._data = data
pyperclip.copy(data.text)
# pyperclip.copy(data.text)

def get_data(self) -> Data:
text = pyperclip.paste()
# text = pyperclip.paste()

# When the clipboard data is equal to what we copied last time, reuse
# the `Data` instance. That way we're sure to keep the same
Expand Down
30 changes: 29 additions & 1 deletion src/quo/console/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,35 @@ async def _run_async2() -> _AppResult:

return await _run_async2()

def command(name:str=None, cls=None, **attrs):
from quo.decorators.core import command as _command

return _command(name=name, cls=cls, **attrs)

@property
def app(self, *param_decls, **attrs)->"Console":
import inspect

from quo.core import App

def decorator(f):
# Issue 926, copy attrs, so pre-defined options can re-use the same cls=

app_attrs = attrs.copy()

if "help" in app_attrs:
app_attrs["help"] = inspect.cleandoc(app_attrs["help"])
AppClass = app_attrs.pop("cls", App)
_param_memo(f, AppClass(param_decls, **app_attrs))
return f

return decorator
# from quo.decorators.core import app as _app

# return _app(*param_decls, **attrs)

@property

def edit(
text=None,
editor=None,
Expand All @@ -837,7 +865,7 @@ def encoding(self) -> "Console":
encode = sys.getdefaultencoding()
print(encode)

def bell(self) -> _AppResult:
def bell(instance:int=3) -> _AppResult:
print("\a" * 3)

def launch(self, url, wait=False, locate=False) -> "Console":
Expand Down
4 changes: 2 additions & 2 deletions src/quo/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,8 @@ def get_autohelp(self, clime):

def show_help(clime, param, value):
if value and not clime.parse:
from quo.layout.layout import Layout
from quo.layout import (
Layout,
Window,
FormattedTextControl,
HSplit,
Expand All @@ -1037,7 +1037,7 @@ def show_help(clime, param, value):
height=1,
),
Label(Text(f"<b>{clime.get_help()}</b>")),
Window(char="_", height=1),
Window(char="\u2501", height=1),
]
)
layout = Layout(root)
Expand Down

0 comments on commit 5895fe1

Please sign in to comment.