Contents

interfaces

Application

API

interface imagect.api.app.IApp[source]

App Interface for imagect

mainwin()

IMainWin

asyncio_loop()

loop for ayncio

rx_scheduler()

scheduler from qt ui loop

showMsg(title, msg)

show message box

appDir()

application dir

appDataDir()

appDataDir dir

imagect.api.app.get()[source]

IMPL

class imagect.core.app.App(argv)[source]

Bases: PyQt5.QtWidgets.QApplication

application

appDataDir() → str[source]
appDir() → str[source]
asyncio_loop()[source]
rx_scheduler()[source]
showMsg(title: str, msg: str)[source]

show message box

Main Window

API

interface imagect.api.mainwin.IMainWin[source]

mainwin of the app

window()

window

menuBar()

menubar

console()

console

imagect.api.mainwin.get()[source]

IMPL

class imagect.core.mainwin.MainWin(parent=None, flags=<PyQt5.QtCore.Qt.WindowFlags object>)[source]

Bases: PyQt5.QtWidgets.QMainWindow

implements IMainWin

console()[source]
menuBar(self) → QMenuBar[source]
showMessage(msg)[source]
shutdown_kernel()[source]
window(self) → QWidget[source]
imagect.core.mainwin.get()[source]
imagect.core.mainwin.make_jupyter_widget_with_kernel()[source]

Start a kernel, connect to it, and create a RichJupyterWidget to use it

Console

API

interface imagect.api.console.IConsole[source]

embeding a python console in app

clear()

clears the terminal

printText(text)

show text in console

execute(command)

execute python statement in console

imagect.api.console.get()[source]

IMPL

class imagect.core.console.Console[source]

Bases: object

embeding a python console in app

clear()[source]

clears the terminal

execute(command)[source]

execute python statement in console

printText(text: str)[source]

show text in console

Action Manager

Intr

method to add a new menu item

method 1
import imagect.api.actmgr
import imagect.core.actmgr
from imagect.api.actmgr import addAct, addActFun, renameAct

@addActFun("file.exampe.msg", text="&Message", index=1)
def apptest():
    win = get()
    win.showMessage("Test Message")
method 2
from imagect.api.actmgr import addActFetch, renameAct
@addActFetch("file.recent", "Recent File", index=2)
def recentMenu(qact : QAction):
    return [ QAction("Recent 1", qact), QAction("Recent 2", qact)]
method 3
import imagect.api.actmgr
import imagect.core.actmgr
from imagect.api.actmgr import addActWdg, renameAct

@addActWdg("file.exampe.wdg", text="Show Widget", index = 3)
class ActWdg(QSpinBox) :
    def __init__(self, parent):
        super().__init__(parent) 

API

interface imagect.api.actmgr.IActMgr[source]

Action Manager

要包含所有的命令节点,每个命令节点包含一个菜单用于显示全部子命令

file

file menu

edit

edit menu

image

image menu

test

test menu

topActions()
addAct(act)

add sub action parent | child

remAct(id)

remove action by id

renameAct(id, title, index=0)

set action title

queryChildren(self, pid)

query actions by parent id

queryAll(self)

query all actions

class imagect.api.actmgr.IAction(icon, id, pid, title, index=0, callable=None, widget=None, fetch=None, shortcut=None)[source]

Bases: object

imagect.api.actmgr.addAct(act: imagect.api.actmgr.IAction)[source]
imagect.api.actmgr.addActFetch(id: str, title: str, index=0, shortcut=None)[source]
imagect.api.actmgr.addActFun(id: str, text: str, index=0, shortcut=None)[source]
imagect.api.actmgr.addActWdg(id: str, text: str, index=0, shortcut=None)[source]
imagect.api.actmgr.creatchFecthAction(id, title, fetch, index=0, shortcut=None)[source]
imagect.api.actmgr.createAction(id, title, callable=None, index=0, shortcut=None)[source]
imagect.api.actmgr.createWAction(id, title, widget=None, index=0, shortcut=None)[source]
imagect.api.actmgr.get()[source]
imagect.api.actmgr.renameAct(id: str, title: str, index=0)[source]
imagect.api.actmgr.toQAction(act: imagect.api.actmgr.IAction, parent: PyQt5.QtCore.QObject)[source]

IMPL

class imagect.core.actmgr.ActMgr[source]

Bases: object

addAct(act: imagect.api.actmgr.IAction)[source]

add sub action parent | child

queryAll() → List[imagect.api.actmgr.IAction][source]
queryChildren(pid: str) → List[imagect.api.actmgr.IAction][source]

todo: sort by index

remAct(id: str)[source]
renameAct(id: str, title: str, index=0)[source]
sort(acts: List[imagect.api.actmgr.IAction]) → List[imagect.api.actmgr.IAction][source]
topActions() → List[PyQt5.QtWidgets.QAction][source]

Recent File Manager

Intr

usage


recent.get().push(filename)

TODO : 要改进一下,不光记录文件路径,还应该记录文件的元信息,以便找到对应的打开方法,及打开时所选参数

API

interface imagect.api.recent.IRecent[source]

push a file to recent file list

push(file)

add to top a the list

clear()

clear the list

getFiles()

return a list a files

imagect.api.recent.get()[source]

IMPL

+:undoc-members: :show-inheritance:

class imagect.core.recent.Rec(time, path)

Bases: tuple

path

Alias for field number 1

time

Alias for field number 0

class imagect.core.recent.Recent[source]

Bases: object

recent file manager

clear()[source]

clear the list

getFiles() → List[str][source]

return a list a files

load()[source]

load file list from file

push(path: str)[source]

add to top a the list

if exist in the list, remove and then push to top

save()[source]

util

others

examples

qt

signal and slots

    def setupMenus(self) :
        mainMenu = self.menuBar()
        fileMenu = mainMenu.addMenu("File")

        show = fileMenu.addAction("Show")

        def showMsg() :
            app.get().showMsg("title", "hello")
        show.triggered.connect(showMsg)

rxqt

imagect documentation

Indices and tables

todos

[] sphinx

[] zope.component

[] mainwin