8239:59a9a658618c | 8240:93b8a353c4bf |
---|---|
7 Module implementing an abstract base class to be subclassed by all specific | 7 Module implementing an abstract base class to be subclassed by all specific |
8 VCS interfaces. | 8 VCS interfaces. |
9 """ | 9 """ |
10 | 10 |
11 import os | 11 import os |
12 import contextlib | |
12 | 13 |
13 from PyQt5.QtCore import ( | 14 from PyQt5.QtCore import ( |
14 QObject, QThread, QMutex, QProcess, Qt, pyqtSignal, QCoreApplication | 15 QObject, QThread, QMutex, QProcess, Qt, pyqtSignal, QCoreApplication |
15 ) | 16 ) |
16 from PyQt5.QtWidgets import QApplication | 17 from PyQt5.QtWidgets import QApplication |
519 @param options a dictionary of option strings with keys as | 520 @param options a dictionary of option strings with keys as |
520 defined by the default options | 521 defined by the default options |
521 """ | 522 """ |
522 if self.vcsSupportCommandOptions(): | 523 if self.vcsSupportCommandOptions(): |
523 for key in options: | 524 for key in options: |
524 try: | 525 with contextlib.suppress(KeyError): |
525 self.options[key] = options[key] | 526 self.options[key] = options[key] |
526 except KeyError: | |
527 pass | |
528 | 527 |
529 def vcsGetOptions(self): | 528 def vcsGetOptions(self): |
530 """ | 529 """ |
531 Public method used to retrieve the options of the vcs. | 530 Public method used to retrieve the options of the vcs. |
532 | 531 |
543 Public method used to set vcs specific data. | 542 Public method used to set vcs specific data. |
544 | 543 |
545 @param data a dictionary of vcs specific data | 544 @param data a dictionary of vcs specific data |
546 """ | 545 """ |
547 for key in data: | 546 for key in data: |
548 try: | 547 with contextlib.suppress(KeyError): |
549 self.otherData[key] = data[key] | 548 self.otherData[key] = data[key] |
550 except KeyError: | |
551 pass | |
552 | 549 |
553 def vcsGetOtherData(self): | 550 def vcsGetOtherData(self): |
554 """ | 551 """ |
555 Public method used to retrieve vcs specific data. | 552 Public method used to retrieve vcs specific data. |
556 | 553 |