Skip to content

Commit

Permalink
Merge branch 'main' of github.com:piksel/pytouch-cube
Browse files Browse the repository at this point in the history
  • Loading branch information
piksel committed Jun 3, 2021
2 parents e01e855 + d93dbef commit d99f866
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions gui/log_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def __init__(self, parent: Optional[QWidget]):
self.setReadOnly(True)
font = QFont('Fira')
font.setStyleHint(QFont.Monospace, QFont.PreferDefault)
font.setFamilies(['Fira', 'Source Code Pro', 'Monaco', 'Consolas', 'Monospaced', 'Courier'])
if hasattr(font, 'setFamilies'):
font.setFamilies(['Fira', 'Source Code Pro', 'Monaco', 'Consolas', 'Monospaced', 'Courier'])
self.setFont(font)

logging.root.addHandler(LogConsoleHandler(self))
Expand Down Expand Up @@ -60,4 +61,4 @@ def __init__(self, log_console: LogConsole):

def emit(self, record: logging.LogRecord):
self.log_console.insertPlainText(record.getMessage() + "\n")
self.log_console.ensureCursorVisible()
self.log_console.ensureCursorVisible()
14 changes: 7 additions & 7 deletions gui/printer_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
class PrinterSelect(QComboBox):
def __init__(self, parent: QWidget):
super().__init__(parent)
self.setPlaceholderText('Select Bluetooth Device...')
#self.setPlaceholderText('Select Bluetooth Device...')
self.setModel(PrinterDevicesModel(self))

@asyncSlot()
async def update(self) -> None:
self.clear()
if is_win:
candidate = await self.update_win()
else:
candidate = await self.update_devfs()
# if is_win:
candidate = await self.update_win()
# else:
# candidate = await self.update_devfs()

#if candidate is not None:
index = self.findText('PT-P3', Qt.MatchContains)
Expand Down Expand Up @@ -59,8 +59,8 @@ async def update_devfs(self) -> Optional[str]:
# printer_select.setExpanded(dev_index, True)
# model_proxy.setFilterWildcard('tty*')

for p in QDir('/dev').entryList(['tty*'], QDir.System, QDir.Name):
if p.startswith('tty.'):
for p in QDir('/dev').entryList(['tty*', 'rfcomm*'], QDir.System, QDir.Name):
if p.startswith('tty.') or p.startswith('rfcomm'):
device = '/dev/' + p

self.addItem(device, device)
Expand Down
4 changes: 2 additions & 2 deletions printables/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def __init__(self, text='', font_string=None, margins: Margins = None):
if font_string is None:
font = QFont()
font.setStyleHint(QFont.Helvetica)
font.setFamily('Helvetica Neue')
if hasattr(font, 'setFamily'):
font.setFamily('Helvetica Neue')

# font.Helvetica
log.debug(f'Default font: {font.family()} {font.families()}, {font.toString()}')
font.setPixelSize(USABLE_HEIGHT)
self.font_string = font.toString()
else:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pyserial~=3.4
packbits~=0.6
pypng
appdirs~=1.4.4
pyyaml~=5.3.1
pyyaml~=5.4.0
qrcode~=6.1
qasync~=0.13.0
setuptools~=41.2.0
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -865,9 +865,9 @@ lodash.map@^4.5.1:
integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=

lodash@^4.17.12, lodash@^4.17.19, lodash@^4.17.20:
version "4.17.20"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==

longest@^2.0.1:
version "2.0.1"
Expand Down

0 comments on commit d99f866

Please sign in to comment.