+ Make transient directory of the form ExeName_Doc_{UUID}_{HASH}_{PID}
+ Set some properties in Document read-only + Implement Document::saveAs + Fix PropertyUUID::setValue() + Add a field for UUID in document information panel
This commit is contained in:
@@ -69,6 +69,25 @@ PyObject* DocumentPy::save(PyObject * args)
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* DocumentPy::saveAs(PyObject * args)
|
||||
{
|
||||
char* fn;
|
||||
if (!PyArg_ParseTuple(args, "s", &fn)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!getDocumentPtr()->saveAs(fn)) {
|
||||
PyErr_Format(PyExc_ValueError, "Object attribute 'FileName' is not set");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Base::FileInfo fi(fn);
|
||||
if (!fi.isReadable()) {
|
||||
PyErr_Format(PyExc_IOError, "No such file or directory: '%s'", fn);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* DocumentPy::restore(PyObject * args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
|
||||
|
||||
Reference in New Issue
Block a user