src/eric7/WebBrowser/SpeedDial/SpeedDialWriter.py

branch
eric7
changeset 10436
f6881d10e995
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10435:c712d09cc839 10436:f6881d10e995
25 25
26 def write(self, fileNameOrDevice, pages, pagesPerRow, speedDialSize): 26 def write(self, fileNameOrDevice, pages, pagesPerRow, speedDialSize):
27 """ 27 """
28 Public method to write a speed dial data file. 28 Public method to write a speed dial data file.
29 29
30 @param fileNameOrDevice name of the file to write (string) 30 @param fileNameOrDevice name of the file to write or device to write to
31 or device to write to (QIODevice) 31 @type str or QIODevice
32 @param pages list of speed dial pages (list of Page) 32 @param pages list of speed dial pages
33 @param pagesPerRow number of pages per row (integer) 33 @type list of Page
34 @param speedDialSize size of the speed dial pages (integer) 34 @param pagesPerRow number of pages per row
35 @return flag indicating success (boolean) 35 @type int
36 @param speedDialSize size of the speed dial pages
37 @type int
38 @return flag indicating success
39 @rtype bool
36 """ 40 """
37 if isinstance(fileNameOrDevice, QIODevice): 41 if isinstance(fileNameOrDevice, QIODevice):
38 f = fileNameOrDevice 42 f = fileNameOrDevice
39 else: 43 else:
40 f = QFile(fileNameOrDevice) 44 f = QFile(fileNameOrDevice)
46 50
47 def __write(self, pages, pagesPerRow, speedDialSize): 51 def __write(self, pages, pagesPerRow, speedDialSize):
48 """ 52 """
49 Private method to write a speed dial file. 53 Private method to write a speed dial file.
50 54
51 @param pages list of speed dial pages (list of Page) 55 @param pages list of speed dial pages
52 @param pagesPerRow number of pages per row (integer) 56 @type list of Page
53 @param speedDialSize size of the speed dial pages (integer) 57 @param pagesPerRow number of pages per row
54 @return flag indicating success (boolean) 58 @type int
59 @param speedDialSize size of the speed dial pages
60 @type int
61 @return flag indicating success
62 @rtype bool
55 """ 63 """
56 self.writeStartDocument() 64 self.writeStartDocument()
57 self.writeDTD("<!DOCTYPE speeddial>") 65 self.writeDTD("<!DOCTYPE speeddial>")
58 self.writeStartElement("SpeedDial") 66 self.writeStartElement("SpeedDial")
59 self.writeAttribute("version", "1.0") 67 self.writeAttribute("version", "1.0")

eric ide

mercurial