improve whitespaces
This commit is contained in:
@@ -144,16 +144,16 @@ PyMethodDef Application::Methods[] = {
|
||||
"Open a macro, Inventor or VRML file"},
|
||||
{"export", (PyCFunction) Application::sExport, 1,
|
||||
"save scene to Inventor or VRML file"},
|
||||
{ "activeDocument", (PyCFunction)Application::sActiveDocument, 1,
|
||||
{"activeDocument", (PyCFunction) Application::sActiveDocument, 1,
|
||||
"activeDocument() -> object or None\n\n"
|
||||
"Return the active document or None if no one exists" },
|
||||
"Return the active document or None if no one exists"},
|
||||
{"setActiveDocument", (PyCFunction) Application::sSetActiveDocument,1,
|
||||
"setActiveDocument(string or App.Document) -> None\n\n"
|
||||
"Activate the specified document"},
|
||||
{ "activeView", (PyCFunction)Application::sActiveView, 1,
|
||||
{"activeView", (PyCFunction)Application::sActiveView, 1,
|
||||
"activeView() -> object or None\n\n"
|
||||
"Return the active view of the active document or None if no one exists" },
|
||||
{ "getDocument", (PyCFunction)Application::sGetDocument, 1,
|
||||
"Return the active view of the active document or None if no one exists"},
|
||||
{"getDocument", (PyCFunction) Application::sGetDocument, 1,
|
||||
"getDocument(string) -> object\n\n"
|
||||
"Get a document by its name"},
|
||||
{"doCommand", (PyCFunction) Application::sDoCommand, 1,
|
||||
@@ -171,39 +171,39 @@ PyMethodDef Application::Methods[] = {
|
||||
{"showPreferences", (PyCFunction) Application::sShowPreferences,1,
|
||||
"showPreferences([string,int]) -> None\n\n"
|
||||
"Shows the preferences window. If string and int are provided, the given page index in the given group is shown."},
|
||||
{"createViewer", (PyCFunction) Application::sCreateViewer,1,
|
||||
"createViewer([int]) -> View3DInventor/SplitView3DInventor\n\n"
|
||||
"shows and returns a viewer. If the integer argument is given and > 1: -> splitViewer"},
|
||||
{"createViewer", (PyCFunction) Application::sCreateViewer,1,
|
||||
"createViewer([int]) -> View3DInventor/SplitView3DInventor\n\n"
|
||||
"shows and returns a viewer. If the integer argument is given and > 1: -> splitViewer"},
|
||||
|
||||
{NULL, NULL, 0, NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
PyObject* Gui::Application::sActiveDocument(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
|
||||
Document *pcDoc = Instance->activeDocument();
|
||||
if (pcDoc) {
|
||||
return pcDoc->getPyObject();
|
||||
}
|
||||
else {
|
||||
Py_Return;
|
||||
}
|
||||
Document *pcDoc = Instance->activeDocument();
|
||||
if (pcDoc) {
|
||||
return pcDoc->getPyObject();
|
||||
}
|
||||
else {
|
||||
Py_Return;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* Gui::Application::sActiveView(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
|
||||
Document *pcDoc = Instance->activeDocument();
|
||||
if (pcDoc) {
|
||||
Gui::MDIView *pcView = pcDoc->getActiveView();
|
||||
if (pcView)
|
||||
// already incremented in getPyObject().
|
||||
return pcView->getPyObject();
|
||||
}
|
||||
Document *pcDoc = Instance->activeDocument();
|
||||
if (pcDoc) {
|
||||
Gui::MDIView *pcView = pcDoc->getActiveView();
|
||||
if (pcView)
|
||||
// already incremented in getPyObject().
|
||||
return pcView->getPyObject();
|
||||
}
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
@@ -278,8 +278,8 @@ PyObject* Application::sGetDocument(PyObject * /*self*/, PyObject *args,PyObject
|
||||
PyObject* Application::sHide(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
char *psFeatStr;
|
||||
if (!PyArg_ParseTuple(args, "s;Name of the object to hide has to be given!",&psFeatStr)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "s;Name of the object to hide has to be given!",&psFeatStr))
|
||||
return NULL;
|
||||
|
||||
Document *pcDoc = Instance->activeDocument();
|
||||
|
||||
@@ -292,8 +292,8 @@ PyObject* Application::sHide(PyObject * /*self*/, PyObject *args,PyObject * /*kw
|
||||
PyObject* Application::sShow(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
char *psFeatStr;
|
||||
if (!PyArg_ParseTuple(args, "s;Name of the object to show has to be given!",&psFeatStr)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "s;Name of the object to show has to be given!",&psFeatStr))
|
||||
return NULL;
|
||||
|
||||
Document *pcDoc = Instance->activeDocument();
|
||||
|
||||
@@ -554,8 +554,8 @@ PyObject* Application::sSendActiveView(PyObject * /*self*/, PyObject *args,PyObj
|
||||
{
|
||||
char *psCommandStr;
|
||||
PyObject *suppress=Py_False;
|
||||
if (!PyArg_ParseTuple(args, "s|O!",&psCommandStr,&PyBool_Type,&suppress)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "s|O!",&psCommandStr,&PyBool_Type,&suppress))
|
||||
return NULL;
|
||||
|
||||
const char* ppReturn=0;
|
||||
if (!Instance->sendMsgToActiveView(psCommandStr,&ppReturn)) {
|
||||
@@ -591,8 +591,8 @@ PyObject* Application::sGetMainWindow(PyObject * /*self*/, PyObject *args,PyObje
|
||||
|
||||
PyObject* Application::sUpdateGui(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
|
||||
qApp->processEvents();
|
||||
|
||||
@@ -602,8 +602,8 @@ PyObject* Application::sUpdateGui(PyObject * /*self*/, PyObject *args,PyObject *
|
||||
|
||||
PyObject* Application::sUpdateLocale(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
|
||||
Translator::instance()->refresh();
|
||||
|
||||
@@ -613,8 +613,8 @@ PyObject* Application::sUpdateLocale(PyObject * /*self*/, PyObject *args,PyObjec
|
||||
|
||||
PyObject* Application::sGetLocale(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
|
||||
std::string locale = Translator::instance()->activeLanguage();
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
@@ -627,8 +627,8 @@ PyObject* Application::sGetLocale(PyObject * /*self*/, PyObject *args,PyObject *
|
||||
PyObject* Application::sCreateDialog(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
char* fn = 0;
|
||||
if (!PyArg_ParseTuple(args, "s", &fn)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "s", &fn))
|
||||
return NULL;
|
||||
|
||||
PyObject* pPyResource=0L;
|
||||
try{
|
||||
@@ -691,8 +691,8 @@ PyObject* Application::sAddPreferencePage(PyObject * /*self*/, PyObject *args,Py
|
||||
PyObject* Application::sActivateWorkbenchHandler(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
char* psKey;
|
||||
if (!PyArg_ParseTuple(args, "s", &psKey)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "s", &psKey))
|
||||
return NULL;
|
||||
|
||||
// search for workbench handler from the dictionary
|
||||
PyObject* pcWorkbench = PyDict_GetItemString(Instance->_pcWorkbenchDictionary, psKey);
|
||||
@@ -733,8 +733,8 @@ PyObject* Application::sAddWorkbenchHandler(PyObject * /*self*/, PyObject *args,
|
||||
{
|
||||
PyObject* pcObject;
|
||||
std::string item;
|
||||
if (!PyArg_ParseTuple(args, "O", &pcObject)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "O", &pcObject))
|
||||
return NULL;
|
||||
|
||||
try {
|
||||
// get the class object 'Workbench' from the main module that is expected
|
||||
@@ -790,8 +790,8 @@ PyObject* Application::sAddWorkbenchHandler(PyObject * /*self*/, PyObject *args,
|
||||
PyObject* Application::sRemoveWorkbenchHandler(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
char* psKey;
|
||||
if (!PyArg_ParseTuple(args, "s", &psKey)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "s", &psKey))
|
||||
return NULL;
|
||||
|
||||
PyObject* wb = PyDict_GetItemString(Instance->_pcWorkbenchDictionary,psKey);
|
||||
if (!wb) {
|
||||
@@ -810,8 +810,8 @@ PyObject* Application::sRemoveWorkbenchHandler(PyObject * /*self*/, PyObject *ar
|
||||
PyObject* Application::sGetWorkbenchHandler(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
char* psKey;
|
||||
if (!PyArg_ParseTuple(args, "s", &psKey)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "s", &psKey))
|
||||
return NULL;
|
||||
|
||||
// get the python workbench object from the dictionary
|
||||
PyObject* pcWorkbench = PyDict_GetItemString(Instance->_pcWorkbenchDictionary, psKey);
|
||||
@@ -826,8 +826,8 @@ PyObject* Application::sGetWorkbenchHandler(PyObject * /*self*/, PyObject *args,
|
||||
|
||||
PyObject* Application::sListWorkbenchHandlers(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
|
||||
Py_INCREF(Instance->_pcWorkbenchDictionary);
|
||||
return Instance->_pcWorkbenchDictionary;
|
||||
@@ -835,12 +835,12 @@ PyObject* Application::sListWorkbenchHandlers(PyObject * /*self*/, PyObject *arg
|
||||
|
||||
PyObject* Application::sActiveWorkbenchHandler(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
|
||||
Workbench* actWb = WorkbenchManager::instance()->active();
|
||||
if (!actWb) {
|
||||
PyErr_SetString(PyExc_AssertionError, "No active workbench\n");
|
||||
PyErr_SetString(PyExc_AssertionError, "No active workbench\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -860,8 +860,8 @@ PyObject* Application::sActiveWorkbenchHandler(PyObject * /*self*/, PyObject *ar
|
||||
PyObject* Application::sAddResPath(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
char* filePath;
|
||||
if (!PyArg_ParseTuple(args, "et", "utf-8", &filePath)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "et", "utf-8", &filePath))
|
||||
return NULL;
|
||||
QString path = QString::fromUtf8(filePath);
|
||||
PyMem_Free(filePath);
|
||||
if (QDir::isRelativePath(path)) {
|
||||
@@ -879,8 +879,8 @@ PyObject* Application::sAddResPath(PyObject * /*self*/, PyObject *args,PyObject
|
||||
PyObject* Application::sAddLangPath(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
char* filePath;
|
||||
if (!PyArg_ParseTuple(args, "et", "utf-8", &filePath)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "et", "utf-8", &filePath))
|
||||
return NULL;
|
||||
QString path = QString::fromUtf8(filePath);
|
||||
PyMem_Free(filePath);
|
||||
if (QDir::isRelativePath(path)) {
|
||||
@@ -897,8 +897,8 @@ PyObject* Application::sAddLangPath(PyObject * /*self*/, PyObject *args,PyObject
|
||||
PyObject* Application::sAddIconPath(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
char* filePath;
|
||||
if (!PyArg_ParseTuple(args, "et", "utf-8", &filePath)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "et", "utf-8", &filePath))
|
||||
return NULL;
|
||||
QString path = QString::fromUtf8(filePath);
|
||||
PyMem_Free(filePath);
|
||||
if (QDir::isRelativePath(path)) {
|
||||
@@ -916,8 +916,8 @@ PyObject* Application::sAddIcon(PyObject * /*self*/, PyObject *args,PyObject * /
|
||||
{
|
||||
char *iconName;
|
||||
char *pixmap;
|
||||
if (!PyArg_ParseTuple(args, "ss", &iconName,&pixmap)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "ss", &iconName,&pixmap))
|
||||
return NULL;
|
||||
|
||||
QPixmap icon;
|
||||
if (BitmapFactory().findPixmapInCache(iconName, icon)) {
|
||||
@@ -954,8 +954,8 @@ PyObject* Application::sAddCommand(PyObject * /*self*/, PyObject *args,PyObject
|
||||
char* pName;
|
||||
char* pSource=0;
|
||||
PyObject* pcCmdObj;
|
||||
if (!PyArg_ParseTuple(args, "sO|s", &pName,&pcCmdObj,&pSource)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "sO|s", &pName,&pcCmdObj,&pSource))
|
||||
return NULL;
|
||||
|
||||
// get the call stack to find the Python module name
|
||||
//
|
||||
@@ -1048,8 +1048,8 @@ PyObject* Application::sRunCommand(PyObject * /*self*/, PyObject *args,PyObject
|
||||
|
||||
PyObject* Application::sListCommands(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
|
||||
std::vector <Command*> cmds = Application::Instance->commandManager().getAllCommands();
|
||||
PyObject* pyList = PyList_New(cmds.size());
|
||||
@@ -1110,8 +1110,8 @@ PyObject* Application::sDoCommandGui(PyObject * /*self*/, PyObject *args, PyObje
|
||||
PyObject* Application::sAddModule(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
char *pstr=0;
|
||||
if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "s", &pstr))
|
||||
return NULL;
|
||||
|
||||
try {
|
||||
Command::addModule(Command::Doc,pstr);
|
||||
@@ -1127,8 +1127,8 @@ PyObject* Application::sAddModule(PyObject * /*self*/, PyObject *args,PyObject *
|
||||
|
||||
PyObject* Application::sShowDownloads(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
Gui::Dialog::DownloadManager::getInstance();
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
@@ -1139,8 +1139,8 @@ PyObject* Application::sShowPreferences(PyObject * /*self*/, PyObject *args,PyOb
|
||||
{
|
||||
char *pstr=0;
|
||||
int idx=0;
|
||||
if (!PyArg_ParseTuple(args, "|si", &pstr, &idx)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "|si", &pstr, &idx))
|
||||
return NULL;
|
||||
Gui::Dialog::DlgPreferencesImp cDlg(getMainWindow());
|
||||
if (pstr)
|
||||
cDlg.activateGroupPage(QString::fromUtf8(pstr),idx);
|
||||
|
||||
Reference in New Issue
Block a user