diff --git a/src/App/ComplexGeoDataPy.xml b/src/App/ComplexGeoDataPy.xml index 00fb61f10b..04a963427d 100644 --- a/src/App/ComplexGeoDataPy.xml +++ b/src/App/ComplexGeoDataPy.xml @@ -66,17 +66,16 @@ - - setElementName(element,name=None,postfix=None,overwrite=False,sid=None), Set an element name + setElementName(element,name=None,postfix=None,overwrite=False,sid=None), Set an element name - element : the original element name, e.g. Edge1, Vertex2 - name : the new name for the element, None to remove the mapping - postfix : postfix of the name that will not be hashed - overwrite: if true, it will overwrite exiting name - sid : to hash the name any way you want, provide your own string id(s) in this parameter +element : the original element name, e.g. Edge1, Vertex2 +name : the new name for the element, None to remove the mapping +postfix : postfix of the name that will not be hashed +overwrite: if true, it will overwrite exiting name +sid : to hash the name any way you want, provide your own string id(s) in this parameter - An element can have multiple mapped names. However, a name can only be mapped - to one element +An element can have multiple mapped names. However, a name can only be mapped +to one element diff --git a/src/App/DocumentObjectPy.xml b/src/App/DocumentObjectPy.xml index ea63126b17..402aa5f2a2 100644 --- a/src/App/DocumentObjectPy.xml +++ b/src/App/DocumentObjectPy.xml @@ -24,7 +24,8 @@ removeProperty(string) -- Remove a generic property. - Note, you can only remove user-defined properties but not built-in ones. + +Note, you can only remove user-defined properties but not built-in ones. @@ -68,7 +69,7 @@ recompute(recursive=False): Recomputes this object - + Returns the status of the object as string. If the object is invalid its error description will be returned. @@ -77,7 +78,7 @@ If the object is valid but touched then 'Touched' will be returned, - + Returns True if the object is valid, False otherwise @@ -169,24 +170,28 @@ Return -1 if element visibility is not supported or element not found, 0 if invi Returns the group the object is in or None if it is not part of a group. - Note that an object can only be in a single group, hence only a single return - value. + +Note that an object can only be in a single group, hence only a single return value. + Returns the GeoFeatureGroup, and hence the local coordinate system, the object - is in or None if it is not part of a group. Note that an object can only be - in a single group, hence only a single return value. +is in or None if it is not part of a group. + +Note that an object can only be in a single group, hence only a single return value. + Returns the group the object is in or None if it is not part of a group. - Note that an object can only be in a single group, hence only a single return - value. - The parent can be a simple group as with getParentGroup() or a - GeoFeature group as with getParentGeoFeatureGroup(). + +Note that an object can only be in a single group, hence only a single return value. +The parent can be a simple group as with getParentGroup() or a GeoFeature group as +with getParentGeoFeatureGroup(). + @@ -235,7 +240,9 @@ Return tuple(obj,newElementName,oldElementName) - isAttachedToDocument(): return true if the object is part of a document, false otherwise + isAttachedToDocument() -> bool + +Return true if the object is part of a document, false otherwise. diff --git a/src/App/DocumentPy.xml b/src/App/DocumentPy.xml index 798994b3c8..6fb1d0659a 100644 --- a/src/App/DocumentPy.xml +++ b/src/App/DocumentPy.xml @@ -43,7 +43,7 @@ Checks if the document is saved - + Get the program version that a project file was created with @@ -60,11 +60,11 @@ For a temporary document it returns its transient directory. getUniqueObjectName(objName) -> objName - Return the same name, or the name made unique, for Example Box -> Box002 if there are conflicting name - already in the document. +Return the same name, or the name made unique, for Example Box -> Box002 if there are conflicting name +already in the document. - ObjName : str - Object name. +ObjName : str +Object name. @@ -127,7 +127,7 @@ viewType (String): override the view provider type directly, only effective when removeProperty(string) -- Remove a generic property. - Note, you can only remove user-defined properties but not built-in ones. +Note, you can only remove user-defined properties but not built-in ones. @@ -142,8 +142,8 @@ viewType (String): override the view provider type directly, only effective when copyObject(object, recursive=False, return_all=False) Copy an object or objects from another document to this document. -object: can either a single object or sequence of objects -recursive: if True, also recursively copies internal objects. +object: can either be a single object or sequence of objects +recursive: if True, also recursively copies internal objects return_all: if True, returns all copied objects, or else return only the copied object corresponding to the input objects. diff --git a/src/App/GroupExtensionPy.xml b/src/App/GroupExtensionPy.xml index 5860051f67..29eeca834a 100644 --- a/src/App/GroupExtensionPy.xml +++ b/src/App/GroupExtensionPy.xml @@ -56,9 +56,10 @@ hasObject(obj, recursive=false) - Checks if the group has a given object - @param obj the object to check for. - @param recursive if true check also if the obj is child of some sub group (default is false). + +Checks if the group has a given object +@param obj the object to check for. +@param recursive if true check also if the obj is child of some sub group (default is false). diff --git a/src/App/MetadataPy.xml b/src/App/MetadataPy.xml index 081b16ed54..2b612d2dae 100644 --- a/src/App/MetadataPy.xml +++ b/src/App/MetadataPy.xml @@ -47,43 +47,43 @@ bytes : bytes String representing the name of this item. - + String representing the version of this item in semantic triplet format. - + String representing the date of this item in YYYY-MM-DD format (format not currently programmatically enforced) - + String representing the type of this item (text only, no markup allowed). - + String representing the description of this item (text only, no markup allowed). - + List of maintainer objects with 'name' and 'email' string attributes. - + List of applicable licenses as objects with 'name' and 'file' string attributes. - + @@ -95,14 +95,14 @@ is one of: * readme * documentation - + List of author objects, each with a 'name' and a (potentially empty) 'email' string attribute. - + @@ -128,53 +128,53 @@ string attribute. * condition Optional. Conditional expression as documented in REP149. - + List of conflicts, format identical to dependencies. - + List of things this item is considered by its author to replace. The format is identical to dependencies. - + List of strings. - + Relative path to an icon file. - + String representing the name of the main Python class this item creates/represents. - + String representing the name of the subdirectory this content item is located in. If empty, the item is in a directory named the same as the content item. - + List of files associated with this item. The meaning of each file is implementation-defined. - + @@ -182,7 +182,7 @@ The meaning of each file is implementation-defined. a Metadata object. See package.xml file format documentation for details. - + @@ -190,7 +190,7 @@ See package.xml file format documentation for details. String representing the minimum version of FreeCAD needed for this item. If unset it will be 0.0.0. - + @@ -198,7 +198,7 @@ If unset it will be 0.0.0. String representing the maximum version of FreeCAD needed for this item. If unset it will be 0.0.0. - + @@ -206,7 +206,7 @@ If unset it will be 0.0.0. String representing the minimum version of Python needed for this item. If unset it will be 0.0.0. - + @@ -432,12 +432,11 @@ Write the metadata to the given file as XML data. - - public: - MetadataPy(const Metadata & pla, PyTypeObject *T = &Type) - :PyObjectBase(new Metadata(pla),T){} - Metadata value() const - { return *(getMetadataPtr()); } + public: + MetadataPy(const Metadata & pla, PyTypeObject *T = &Type) + :PyObjectBase(new Metadata(pla),T){} + Metadata value() const + { return *(getMetadataPtr()); } diff --git a/src/App/MetadataPyImp.cpp b/src/App/MetadataPyImp.cpp index 953f2799dc..1097081c39 100644 --- a/src/App/MetadataPyImp.cpp +++ b/src/App/MetadataPyImp.cpp @@ -136,12 +136,12 @@ int MetadataPy::PyInit(PyObject* args, PyObject* /*kwd*/) return -1; } -Py::Object MetadataPy::getName() const +Py::String MetadataPy::getName() const { return Py::String(getMetadataPtr()->name()); } -void MetadataPy::setName(Py::Object args) +void MetadataPy::setName(Py::String args) { const char* name = nullptr; if (!PyArg_Parse(args.ptr(), "z", &name)) { @@ -155,12 +155,12 @@ void MetadataPy::setName(Py::Object args) } } -Py::Object MetadataPy::getVersion() const +Py::String MetadataPy::getVersion() const { return Py::String(getMetadataPtr()->version().str()); } -void MetadataPy::setVersion(Py::Object args) +void MetadataPy::setVersion(Py::String args) { const char* name = nullptr; if (!PyArg_Parse(args.ptr(), "z", &name)) { @@ -174,12 +174,12 @@ void MetadataPy::setVersion(Py::Object args) } } -Py::Object MetadataPy::getDate() const +Py::String MetadataPy::getDate() const { return Py::String(getMetadataPtr()->date()); } -void MetadataPy::setDate(Py::Object args) +void MetadataPy::setDate(Py::String args) { const char* date = nullptr; if (!PyArg_Parse(args.ptr(), "z", &date)) { @@ -193,12 +193,12 @@ void MetadataPy::setDate(Py::Object args) } } -Py::Object MetadataPy::getDescription() const +Py::String MetadataPy::getDescription() const { return Py::String(getMetadataPtr()->description()); } -void MetadataPy::setDescription(Py::Object args) +void MetadataPy::setDescription(Py::String args) { const char* description = nullptr; if (!PyArg_Parse(args.ptr(), "s", &description)) { @@ -207,12 +207,12 @@ void MetadataPy::setDescription(Py::Object args) getMetadataPtr()->setDescription(description); } -Py::Object MetadataPy::getType() const +Py::String MetadataPy::getType() const { return Py::String(getMetadataPtr()->type()); } -void MetadataPy::setType(Py::Object args) +void MetadataPy::setType(Py::String args) { const char* type = nullptr; if (!PyArg_Parse(args.ptr(), "s", &type)) { @@ -221,7 +221,7 @@ void MetadataPy::setType(Py::Object args) getMetadataPtr()->setType(type); } -Py::Object MetadataPy::getMaintainer() const +Py::List MetadataPy::getMaintainer() const { auto maintainers = getMetadataPtr()->maintainer(); Py::List pyMaintainers; @@ -234,7 +234,7 @@ Py::Object MetadataPy::getMaintainer() const return pyMaintainers; } -void MetadataPy::setMaintainer(Py::Object args) +void MetadataPy::setMaintainer(Py::List args) { PyObject* list = nullptr; if (!PyArg_Parse(args.ptr(), "O!", &PyList_Type, &list)) { @@ -276,7 +276,7 @@ PyObject* MetadataPy::removeMaintainer(PyObject* args) } -Py::Object MetadataPy::getAuthor() const +Py::List MetadataPy::getAuthor() const { auto authors = getMetadataPtr()->author(); Py::List pyAuthors; @@ -289,7 +289,7 @@ Py::Object MetadataPy::getAuthor() const return pyAuthors; } -void MetadataPy::setAuthor(Py::Object args) +void MetadataPy::setAuthor(Py::List args) { PyObject* list = nullptr; if (!PyArg_Parse(args.ptr(), "O!", &PyList_Type, &list)) { @@ -330,7 +330,7 @@ PyObject* MetadataPy::removeAuthor(PyObject* args) return Py_None; } -Py::Object MetadataPy::getLicense() const +Py::List MetadataPy::getLicense() const { auto licenses = getMetadataPtr()->license(); Py::List pyLicenses; @@ -343,7 +343,7 @@ Py::Object MetadataPy::getLicense() const return pyLicenses; } -void MetadataPy::setLicense(Py::Object args) +void MetadataPy::setLicense(Py::List args) { PyObject* list = nullptr; if (!PyArg_Parse(args.ptr(), "O!", &PyList_Type, &list)) { @@ -384,7 +384,7 @@ PyObject* MetadataPy::removeLicense(PyObject* args) return Py_None; } -Py::Object MetadataPy::getUrls() const +Py::List MetadataPy::getUrls() const { auto urls = getMetadataPtr()->url(); Py::List pyUrls; @@ -422,7 +422,7 @@ Py::Object MetadataPy::getUrls() const return pyUrls; } -void MetadataPy::setUrls(Py::Object args) +void MetadataPy::setUrls(Py::List args) { PyObject* list = nullptr; if (!PyArg_Parse(args.ptr(), "O!", &PyList_Type, &list)) { @@ -591,7 +591,7 @@ Meta::Dependency pyObjectToDependency(const Py::Object& d) return result; } -Py::Object MetadataPy::getDepend() const +Py::List MetadataPy::getDepend() const { auto dependencies = getMetadataPtr()->depend(); Py::List pyDependencies; @@ -601,7 +601,7 @@ Py::Object MetadataPy::getDepend() const return pyDependencies; } -void MetadataPy::setDepend(Py::Object args) +void MetadataPy::setDepend(Py::List args) { PyObject* list = nullptr; if (!PyArg_Parse(args.ptr(), "O!", &PyList_Type, &list)) { @@ -640,7 +640,7 @@ PyObject* MetadataPy::removeDepend(PyObject* args) return Py_None; } -Py::Object MetadataPy::getConflict() const +Py::List MetadataPy::getConflict() const { auto dependencies = getMetadataPtr()->conflict(); Py::List pyDependencies; @@ -650,7 +650,7 @@ Py::Object MetadataPy::getConflict() const return pyDependencies; } -void MetadataPy::setConflict(Py::Object args) +void MetadataPy::setConflict(Py::List args) { PyObject* list = nullptr; if (!PyArg_Parse(args.ptr(), "O!", &PyList_Type, &list)) { @@ -689,7 +689,7 @@ PyObject* MetadataPy::removeConflict(PyObject* args) return Py_None; } -Py::Object MetadataPy::getReplace() const +Py::List MetadataPy::getReplace() const { auto dependencies = getMetadataPtr()->replace(); Py::List pyDependencies; @@ -699,7 +699,7 @@ Py::Object MetadataPy::getReplace() const return pyDependencies; } -void MetadataPy::setReplace(Py::Object args) +void MetadataPy::setReplace(Py::List args) { PyObject* list = nullptr; if (!PyArg_Parse(args.ptr(), "O!", &PyList_Type, &list)) { @@ -740,7 +740,7 @@ PyObject* MetadataPy::removeReplace(PyObject* args) // Tag, icon, classname, file -Py::Object MetadataPy::getTag() const +Py::List MetadataPy::getTag() const { auto tags = getMetadataPtr()->tag(); Py::List pyTags; @@ -750,7 +750,7 @@ Py::Object MetadataPy::getTag() const return pyTags; } -void MetadataPy::setTag(Py::Object args) +void MetadataPy::setTag(Py::List args) { PyObject* list = nullptr; if (!PyArg_Parse(args.ptr(), "O!", &PyList_Type, &list)) { @@ -787,12 +787,12 @@ PyObject* MetadataPy::removeTag(PyObject* args) return Py_None; } -Py::Object MetadataPy::getIcon() const +Py::String MetadataPy::getIcon() const { return Py::String(getMetadataPtr()->icon().string()); } -void MetadataPy::setIcon(Py::Object args) +void MetadataPy::setIcon(Py::String args) { const char* name; if (!PyArg_Parse(args.ptr(), "s", &name)) { @@ -801,12 +801,12 @@ void MetadataPy::setIcon(Py::Object args) getMetadataPtr()->setIcon(name); } -Py::Object MetadataPy::getClassname() const +Py::String MetadataPy::getClassname() const { return Py::String(getMetadataPtr()->classname()); } -void MetadataPy::setClassname(Py::Object args) +void MetadataPy::setClassname(Py::String args) { const char* name; if (!PyArg_Parse(args.ptr(), "s", &name)) { @@ -815,12 +815,12 @@ void MetadataPy::setClassname(Py::Object args) getMetadataPtr()->setClassname(name); } -Py::Object MetadataPy::getSubdirectory() const +Py::String MetadataPy::getSubdirectory() const { return Py::String(getMetadataPtr()->subdirectory().string()); } -void MetadataPy::setSubdirectory(Py::Object args) +void MetadataPy::setSubdirectory(Py::String args) { const char* name; if (!PyArg_Parse(args.ptr(), "s", &name)) { @@ -829,7 +829,7 @@ void MetadataPy::setSubdirectory(Py::Object args) getMetadataPtr()->setSubdirectory(name); } -Py::Object MetadataPy::getFile() const +Py::List MetadataPy::getFile() const { auto files = getMetadataPtr()->file(); Py::List pyFiles; @@ -839,7 +839,7 @@ Py::Object MetadataPy::getFile() const return pyFiles; } -void MetadataPy::setFile(Py::Object args) +void MetadataPy::setFile(Py::List args) { PyObject* list = nullptr; if (!PyArg_Parse(args.ptr(), "O!", &PyList_Type, &list)) { @@ -877,7 +877,7 @@ PyObject* MetadataPy::removeFile(PyObject* args) } -Py::Object MetadataPy::getContent() const +Py::Dict MetadataPy::getContent() const { auto content = getMetadataPtr()->content(); std::set keys; @@ -899,7 +899,7 @@ Py::Object MetadataPy::getContent() const return pyContent; } -void MetadataPy::setContent(Py::Object arg) +void MetadataPy::setContent(Py::Dict arg) { PyObject* obj = nullptr; if (!PyArg_Parse(arg.ptr(), "O!", &PyList_Type, &obj)) { @@ -940,12 +940,12 @@ PyObject* MetadataPy::getGenericMetadata(PyObject* args) return Py::new_reference_to(pyGenericMetadata); } -Py::Object MetadataPy::getFreeCADMin() const +Py::String MetadataPy::getFreeCADMin() const { return Py::String(getMetadataPtr()->freecadmin().str()); } -void MetadataPy::setFreeCADMin(Py::Object args) +void MetadataPy::setFreeCADMin(Py::String args) { char* version = nullptr; PyObject* p = args.ptr(); @@ -960,12 +960,12 @@ void MetadataPy::setFreeCADMin(Py::Object args) } } -Py::Object MetadataPy::getFreeCADMax() const +Py::String MetadataPy::getFreeCADMax() const { return Py::String(getMetadataPtr()->freecadmax().str()); } -void MetadataPy::setFreeCADMax(Py::Object args) +void MetadataPy::setFreeCADMax(Py::String args) { char* version = nullptr; PyObject* p = args.ptr(); @@ -981,12 +981,12 @@ void MetadataPy::setFreeCADMax(Py::Object args) } } -Py::Object MetadataPy::getPythonMin() const +Py::String MetadataPy::getPythonMin() const { return Py::String(getMetadataPtr()->pythonmin().str()); } -void MetadataPy::setPythonMin(Py::Object args) +void MetadataPy::setPythonMin(Py::String args) { char* version = nullptr; PyObject* p = args.ptr(); diff --git a/src/App/PropertyContainerPy.xml b/src/App/PropertyContainerPy.xml index 572e2ab145..806afe8420 100644 --- a/src/App/PropertyContainerPy.xml +++ b/src/App/PropertyContainerPy.xml @@ -22,7 +22,7 @@ Returns the value of a named property. Note that the returned property may not always belong to this container (e.g. from a linked object). name : str - Name of the property. + Name of the property. checkOwner : int 0: just return the property. 1: raise exception if not found or the property does not belong to this container. diff --git a/src/App/StringIDPy.xml b/src/App/StringIDPy.xml index acee95d628..3f0c3f01ae 100644 --- a/src/App/StringIDPy.xml +++ b/src/App/StringIDPy.xml @@ -59,6 +59,6 @@ private: friend class StringID; int _index = 0; - +