Skip to content

Commit

Permalink
rename io.py to convert.py and refactor functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jborbely committed May 17, 2020
1 parent 60eeef4 commit 9e868f4
Show file tree
Hide file tree
Showing 18 changed files with 884 additions and 880 deletions.
7 changes: 7 additions & 0 deletions docs/_api/msl.qt.convert.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
msl\.qt\.convert module
=======================

.. automodule:: msl.qt.convert
:members:
:undoc-members:
:show-inheritance:
7 changes: 0 additions & 7 deletions docs/_api/msl.qt.io.rst

This file was deleted.

6 changes: 3 additions & 3 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _api:
.. _msl-qt-api:

========================
MSL-Qt API Documentation
Expand All @@ -15,8 +15,8 @@ which has the following modules
.. autosummary::

msl.qt.constants
msl.qt.convert
msl.qt.exceptions
msl.qt.io
msl.qt.prompt
msl.qt.threading
msl.qt.utils
Expand Down Expand Up @@ -47,8 +47,8 @@ Package Structure

msl.qt <_api/msl.qt>
msl.qt.constants <_api/msl.qt.constants>
msl.qt.convert <_api/msl.qt.convert>
msl.qt.exceptions <_api/msl.qt.exceptions>
msl.qt.io <_api/msl.qt.io>
msl.qt.loop_until_abort <_api/msl.qt.loop_until_abort>
msl.qt.prompt <_api/msl.qt.prompt>
msl.qt.sleep <_api/msl.qt.sleep>
Expand Down
7 changes: 4 additions & 3 deletions msl/examples/qt/show_standard_icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
QtWidgets,
QtCore,
application,
io
convert
)

try:
Expand Down Expand Up @@ -103,7 +103,7 @@ def add_qt_tab(self, label, icons):
num_cols = 4
for i in icons:
button = QtWidgets.QPushButton(i)
ico = io.get_icon(getattr(QtWidgets.QStyle, i))
ico = convert.to_qicon(getattr(QtWidgets.QStyle, i))
button.setIcon(ico)
button.clicked.connect(lambda *args, ic=ico, n=i: self.zoom(ic, n))

Expand Down Expand Up @@ -132,7 +132,7 @@ def add_windows_tab(self):
button = QtWidgets.QPushButton(str(index))
try:
name = '{}|{}'.format(filename, str(index))
ico = io.get_icon(name)
ico = convert.to_qicon(name)
except IOError:
break

Expand Down Expand Up @@ -165,6 +165,7 @@ def zoom(self, ico, name):

def close_event(self, event):
self.zoom_widget.close()
event.accept()


if __name__ == '__main__':
Expand Down
6 changes: 3 additions & 3 deletions msl/qt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,18 @@ def application(*args):
'wg+l4cFJPH1ynI9qM6dLwwPPIPecsKvBXytvXi4U9vpc8oaMfFSbeQ1QaeixEyCP2Yfnahe+KA0PPm9SCeP' \
'ns7XZd0pDR49A8qrM3Eht5lgF/H9lKAuFC5KM1me5V48ZAVgBwJTNgwLD3/f3Q2sm57LA/SbCSuMiUggKpK' \
'QbQN4KwgXy9AA4r13gAhPhxfL6T8y/FrQlyIjl7wYAAAAASUVORK5CYII='
app.setWindowIcon(io.get_icon(QtCore.QByteArray(logo.encode())))
app.setWindowIcon(convert.to_qicon(QtCore.QByteArray(logo.encode())))

return app


from ._qt import *
from .exceptions import excepthook
from . import io
from . import utils
from .loop_until_abort import LoopUntilAbort
from . import prompt
from .sleep import Sleep
from . import convert
from .threading import (
Thread,
Worker,
Expand All @@ -72,4 +73,3 @@ def application(*args):
SpinBox,
LED,
)
from . import utils

0 comments on commit 9e868f4

Please sign in to comment.