33 ] |
33 ] |
34 |
34 |
35 |
35 |
36 class Pep8Fixer(QObject): |
36 class Pep8Fixer(QObject): |
37 """ |
37 """ |
38 Class implementing a fixer for certain PEP 8 issues. |
38 Class implementing a fixer for certain code style issues. |
39 """ |
39 """ |
40 def __init__(self, project, filename, sourceLines, fixCodes, noFixCodes, |
40 def __init__(self, project, filename, sourceLines, fixCodes, noFixCodes, |
41 maxLineLength, inPlace): |
41 maxLineLength, inPlace): |
42 """ |
42 """ |
43 Constructor |
43 Constructor |
158 try: |
158 try: |
159 Utilities.writeEncodedFile(self.__filename, txt, encoding) |
159 Utilities.writeEncodedFile(self.__filename, txt, encoding) |
160 except (IOError, Utilities.CodingError, UnicodeError) as err: |
160 except (IOError, Utilities.CodingError, UnicodeError) as err: |
161 E5MessageBox.critical( |
161 E5MessageBox.critical( |
162 self, |
162 self, |
163 self.trUtf8("Fix PEP 8 issues"), |
163 self.trUtf8("Fix Code Style Issues"), |
164 self.trUtf8( |
164 self.trUtf8( |
165 """<p>Could not save the file <b>{0}</b>.""" |
165 """<p>Could not save the file <b>{0}</b>.""" |
166 """ Skipping it.</p><p>Reason: {1}</p>""") |
166 """ Skipping it.</p><p>Reason: {1}</p>""") |
167 .format(self.__filename, str(err)) |
167 .format(self.__filename, str(err)) |
168 ) |
168 ) |