configer

class jukeboxcore.addons.configer.configer.ConfigerWin(parent=None)[source]

Bases: jukeboxcore.gui.main.JB_MainWindow, jukeboxcore.addons.configer.configer_ui.Ui_configer_mwin

A Configeditor window

The window uses the configer.ui for it’s Layout. It has a main editor treeview to edit the ConfigObjs. Next to it is a listview to select the configs. There are also two buttons. One is for saving, the other for reseting a value to its default.

the get_configs method is used to gather all the config files in the userfolder and finding the corresponding configspec in any of the plugin folders.

Constructs a new ConfigerWin

Parameters:parent (QWidget) – Optional - the parent of the window - default is None
Returns:None
Return type:None
Raises:None

This will also load all configs and display the first one.

reset_current_row(*args, **kwargs)[source]

Reset the selected rows value to its default value

Returns:None
Return type:None
Raises:None
get_configs()[source]

Load all config files and return the configobjs

Returns:a list of configobjs
Raises:None

It always loads the coreconfig. Then it looks for all configs inside the PLUGIN_CONFIG_DIR. It will find the corresponding spec of the plugins. If there is a spec, but no ini, it will also be loaded!

find_inifiles(path)[source]

Return all ini-files in the directory of path and below

Parameters:path (str) – a path to a directory
Returns:list of configfiles
Return type:list of str
Raises:None
set_inifile(current, previous)[source]

Set the configobj to the current index of the files_lv

This is a slot for the currentChanged signal

Parameters:
  • current (QModelIndex) – the modelindex of a inifilesmodel that should be set for the configobj_treev
  • previous (QModelIndex) – the previous selected index
Returns:

None

Raises:

None

iniedited(*args, **kwargs)[source]

Set the current index of inimodel to modified

Returns:None
Return type:None
Raises:None
closeEvent(event)[source]

Handles closing of the window. If configs were edited, ask user to continue.

Parameters:event (QCloseEvent) – the close event
Returns:None
Return type:None
Raises:None
doc_modified_prompt()[source]

Create a message box, that asks the user to continue although files have been modified

Returns:value of the standard button of qmessagebox that has been pressed. Either Yes or Cancel.
Return type:QtGui.QMessageBox.StandardButton
Raises:None
invalid_prompt()[source]

Create a message box, that asks the user to continue although files are invalid

Returns:value of the standard button of qmessagebox that has been pressed. Either Yes or Cancel.
Return type:QtGui.QMessageBox.StandardButton
Raises:None
save_current_config()[source]

Saves the currently displayed config

Returns:None
Return type:None
Raises:None

This resets the edited status of the file to False. Also asks the user to continue if config is invalid.

staticMetaObject = <PySide.QtCore.QMetaObject object at 0x0000000004F76688>
class jukeboxcore.addons.configer.configer.Configer[source]

Bases: jukeboxcore.plugins.JB_CoreStandaloneGuiPlugin

A plugin that can run a ConfigEditor

This can be used as a standalone plugin. Before you call run, make sure that there is a running QApplication running. See jukeboxcore.gui.main for helpful functions.

Constructs a new Plugin

Returns:None
Return type:None
Raises:None
author = 'David Zuber'
copyright = '2014'
version = '0.1'
description = 'A tool for editing config files'
init()[source]

Do nothing on init! Call run() if you want to start the configeditor

Returns:None
Return type:None
Raises:None
uninit()[source]

Do nothing on uninit!

Returns:None
Return type:None
Raises:None
run(parent=None)[source]

Start the configeditor

Returns:None
Return type:None
Raises:None