r17396 by fschmid - Fixed Bug 10586: "Script ColorChart.py misbehaves with 2 or more opened documents."

scribus-commit scribus-commit at lists.scribus.net
Wed Mar 21 21:36:36 UTC 2012


Author: fschmid
Date: Wed Mar 21 21:36:35 2012
New Revision: 17396

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17396
Log:
Fixed Bug 10586: "Script ColorChart.py misbehaves with 2 or more opened documents."

Modified:
    trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote.py
    trunk/Scribus/scribus/plugins/scriptplugin/scripts/CalendarWizard.py
    trunk/Scribus/scribus/plugins/scriptplugin/scripts/ColorChart.py
    trunk/Scribus/scribus/plugins/scriptplugin/scripts/DirectImageImport.py
    trunk/Scribus/scribus/plugins/scriptplugin/scripts/FontSample.py
    trunk/Scribus/scribus/plugins/scriptplugin/scripts/color2csv.py
    trunk/Scribus/scribus/plugins/scriptplugin/scripts/csv2color.py
    trunk/Scribus/scribus/plugins/scriptplugin/scripts/importcsv2table.py

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17396&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote.py (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote.py Wed Mar 21 21:36:35 2012
@@ -17,7 +17,7 @@
 """
 import scribus
 
-if scribus.haveDoc():
+if scribus.haveDoc() > 0:
     c = 0
     lang = scribus.valueDialog("Choose by language or country", 'Language: af, be, ch, cs, de, en, es, et, fi, fr,\n hu, is, lt, mk, nl, pl, ru, se, sk, sl, sq and uk\n are current choices','en')
     if (lang == 'en'):

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/CalendarWizard.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17396&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/CalendarWizard.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/CalendarWizard.py (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/CalendarWizard.py Wed Mar 21 21:36:35 2012
@@ -660,7 +660,7 @@
         app = TkCalendar(root)
         root.mainloop()
     finally:
-        if haveDoc():
+        if haveDoc() > 0:
             redrawAll()
         statusMessage('Done.')
         progressReset()

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/ColorChart.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17396&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/ColorChart.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/ColorChart.py (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/ColorChart.py Wed Mar 21 21:36:35 2012
@@ -129,7 +129,7 @@
         return list
 
     #check if we have a document - otherwise display open file dialog
-    if scribus.haveDoc() == 1:
+    if scribus.haveDoc() > 0:
         pass
         list=getColors()
         return list

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/DirectImageImport.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17396&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/DirectImageImport.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/DirectImageImport.py (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/DirectImageImport.py Wed Mar 21 21:36:35 2012
@@ -88,7 +88,7 @@
 
     
 if __name__ == '__main__':
-    if haveDoc():
+    if haveDoc() > 0:
         main()
     else:
         messageBox("Image Import", "You need to have a document open <i>before</i> you can run this script succesfully.", ICON_INFORMATION)

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/FontSample.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17396&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/FontSample.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/FontSample.py (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/FontSample.py Wed Mar 21 21:36:35 2012
@@ -1564,7 +1564,7 @@
         # Exit neatly even if the script terminated with an exception,
         # so we leave the progress bar and status bar blank and make sure
         # drawing is enabled.
-        if scribus.haveDoc():
+        if scribus.haveDoc() > 0:
             scribus.setRedraw(True)
         scribus.statusMessage('')
         scribus.progressReset()

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/color2csv.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17396&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/color2csv.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/color2csv.py (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/color2csv.py Wed Mar 21 21:36:35 2012
@@ -103,7 +103,7 @@
 
 def main(argv):
     """Main method - here we check if we have a doc - else we open one. we get all the colors and write them to a csv file."""
-    if scribus.haveDoc():  #DOC OPEN
+    if scribus.haveDoc() > 0:  #DOC OPEN
     #get colors, get filename, write stuff
         cols = getColorsFromDoc()
         filename = scribus.fileDialog("color2csv: Save csv color file", defaultname="colors.csv",  issave=True ,  haspreview=False)

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/csv2color.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17396&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/csv2color.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/csv2color.py (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/csv2color.py Wed Mar 21 21:36:35 2012
@@ -138,7 +138,7 @@
 
 def main(argv):
     """Main method for importing colors."""
-    if not scribus.haveDoc(): #do we have a doc?
+    if not scribus.haveDoc() > 0: #do we have a doc?
         scribus.messageBox("csv2color", "No document to import colors \n Please open one, first.")
         sys.exit()
     else:

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/importcsv2table.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17396&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/importcsv2table.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/importcsv2table.py (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/importcsv2table.py Wed Mar 21 21:36:35 2012
@@ -196,7 +196,7 @@
         # Exit neatly even if the script terminated with an exception,
         # so we leave the progress bar and status bar blank and make sure
         # drawing is enabled.
-        if scribus.haveDoc():
+        if scribus.haveDoc() > 0:
             scribus.setRedraw(True)
         scribus.statusMessage("")
         scribus.progressReset()




More information about the scribus-commit mailing list