magicclass.utils package

Submodules

magicclass.utils.functions module

class magicclass.utils.functions.MessageBoxMode(value)[source]

Bases: enum.Enum

An enumeration.

ABOUT = 'about'
ERROR = 'error'
INFO = 'info'
QUESTION = 'question'
WARNING = 'warn'
magicclass.utils.functions.extract_tooltip(obj: Any) str[source]
magicclass.utils.functions.get_signature(func)[source]

Similar to inspect.signature but safely returns MagicMethodSignature.

magicclass.utils.functions.iter_members(cls: type, exclude_prefix: str = '__') list[str, typing.Any][source]

Iterate over all the members in the order of source code line number. This function is identical to inspect.getmembers except for the order of the results. We have to sort the name in the order of line number.

magicclass.utils.functions.open_url(link: str) None[source]

Open the link with the default browser.

Parameters

link (str) -- Link to the home page.

magicclass.utils.functions.screen_center()[source]

Get the center coordinate of the screen.

magicclass.utils.functions.show_messagebox(mode: str | MessageBoxMode = MessageBoxMode.INFO, title: str = None, text: str = None, parent=None) bool[source]

Freeze the GUI and open a messagebox dialog.

Parameters
  • mode (str or MessageBoxMode, default is MessageBoxMode.INFO) -- Mode of message box. Must be "error", "warn", "info", "question" or "about".

  • title (str, optional) -- Title of messagebox.

  • text (str, optional) -- Text in messagebox.

  • parent (QWidget, optional) -- Parent widget.

Returns

If "OK" or "Yes" is clicked, return True. Otherwise return False.

Return type

bool

magicclass.utils.functions.to_clipboard(obj: Any) None[source]

Copy an object of any type to the clipboard. You can copy text, ndarray as an image or data frame as a table data.

Parameters

obj (Any) -- Object to be copied.

Module contents