View Issue Details

IDProjectCategoryView StatusLast Update
0016212ScribusScripterpublic2020-08-14 06:01
Reporterale Assigned Toale  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.5.6.svn 
Target VersionFixed in Version1.5.6.svn 
Summary0016212: Fix docstrings for the scripter's pdfexport and print
Descriptionthey do not have the same format as all the other functions...
TagsNo tags attached.
PatchYes

Activities

ale

2020-08-13 17:12

manager  

obj_doc.diff (2,144 bytes)
diff --git a/scribus/plugins/scriptplugin/objpdffile.cpp b/scribus/plugins/scriptplugin/objpdffile.cpp
index 324093ef6..64a5251f2 100644
--- a/scribus/plugins/scriptplugin/objpdffile.cpp
+++ b/scribus/plugins/scriptplugin/objpdffile.cpp
@@ -1648,7 +1648,7 @@ static PyObject *PDFfile_save(PDFfile *self)
 }
 
 static PyMethodDef PDFfile_methods[] = {
-	{const_cast<char*>("save"), (PyCFunction)PDFfile_save, METH_NOARGS, const_cast<char*>("Save selected pages to pdf file")},
+	{const_cast<char*>("save"), (PyCFunction)PDFfile_save, METH_NOARGS, pdffile_save__doc__},
 	{nullptr, (PyCFunction)(nullptr), 0, nullptr} // sentinel
 };
 
diff --git a/scribus/plugins/scriptplugin/objpdffile.h b/scribus/plugins/scriptplugin/objpdffile.h
index d840798ac..7045032c8 100644
--- a/scribus/plugins/scriptplugin/objpdffile.h
+++ b/scribus/plugins/scriptplugin/objpdffile.h
@@ -28,4 +28,6 @@ pdf.thumbnails = 1 # generate thumbnails too\n\
 pdf.file = 'mypdf.pdf' \n\
 pdf.save()");
 
+PyDoc_STRVAR(pdffile_save__doc__, "save() -> void\n\nSave selected pages to pdf file.");
+
 #endif /* OBJPDFFILE_H */
diff --git a/scribus/plugins/scriptplugin/objprinter.cpp b/scribus/plugins/scriptplugin/objprinter.cpp
index 6fb5b34be..dceea377c 100644
--- a/scribus/plugins/scriptplugin/objprinter.cpp
+++ b/scribus/plugins/scriptplugin/objprinter.cpp
@@ -506,7 +506,7 @@ static PyObject *Printer_print(Printer *self)
 }
 
 static PyMethodDef Printer_methods[] = {
-	{const_cast<char*>("printNow"), (PyCFunction)Printer_print, METH_NOARGS, const_cast<char*>("Prints selected pages.")},
+	{const_cast<char*>("printNow"), (PyCFunction)Printer_print, METH_NOARGS, printer_printnow__doc__},
 	{nullptr, (PyCFunction)(nullptr), 0, nullptr} // sentinel
 };
 
diff --git a/scribus/plugins/scriptplugin/objprinter.h b/scribus/plugins/scriptplugin/objprinter.h
index cf834a220..61ebac9bf 100644
--- a/scribus/plugins/scriptplugin/objprinter.h
+++ b/scribus/plugins/scriptplugin/objprinter.h
@@ -25,4 +25,6 @@ Example:\n\
 p = Printer()\n\
 p.print()");
 
+PyDoc_STRVAR(printer_printnow__doc__, "printNow() -> boolean\n\nPrints selected pages.");
+
 #endif /* OBJPRINTER_H */
obj_doc.diff (2,144 bytes)

jghali

2020-08-14 03:18

administrator   ~0047931

Applied! Btw when you provide a patch for scripter, please do not forget to provide equivalent modifications for legacy Python 2.x scripter which is still used on Mac.

ale

2020-08-14 06:01

manager   ~0047933

on the one side, i have no way to check if the patch for python2 is correct (since i cannot compile it).

on the other side, i would suggest you to put the python2 scripter in maintenance mode.
there is so little manpower in scribus, and i cannot see how it could be a good idea to keep two versions of the scripts around.

if no solution for python3 on mac is found before 1.6 is released, just do an effort there to reconvert back the python3 based engine to python2.
and hope that until then we have a solution for python3 on mac.
(and if there is somebody who cares enough about python2 and mac just let that person make the patches... still a waste of little time in my eyes, but better than bothering everyone with that)..

Issue History

Date Modified Username Field Change
2020-08-13 17:12 ale New Issue
2020-08-13 17:12 ale File Added: obj_doc.diff
2020-08-14 03:16 jghali Summary PATCH: fix docstring for the scripter's pdfexport and print => Fix docstrings for the scripter's pdfexport and print
2020-08-14 03:18 jghali Assigned To => ale
2020-08-14 03:18 jghali Status new => resolved
2020-08-14 03:18 jghali Resolution open => fixed
2020-08-14 03:18 jghali Fixed in Version => 1.5.6.svn
2020-08-14 03:18 jghali Note Added: 0047931
2020-08-14 06:01 ale Note Added: 0047933