• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SPF-OST / pytrnsys_gui / 11662562960

29 Oct 2024 03:09PM UTC coverage: 67.508% (-0.08%) from 67.591%
11662562960

push

github

web-flow
Merge pull request #564 from SPF-OST/560-black-change-line-length-to-pep8-standard-of-79-and-check-ci-reaction

changed line length in black to 79

1054 of 1475 new or added lines in 174 files covered. (71.46%)

150 existing lines in 74 files now uncovered.

10399 of 15404 relevant lines covered (67.51%)

0.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

45.45
/trnsysGUI/components/pluginComponent.py
1
import typing as _tp
1✔
2

3
import pytrnsys.utils.result as _res
1✔
4

5
import trnsysGUI.blockItemGraphicItemMixins as _gimx
1✔
6
import trnsysGUI.blockItemHasInternalPiping as _bip
1✔
7
import trnsysGUI.images as _img
1✔
8
import trnsysGUI.internalPiping as _ip
1✔
9

10
from .plugin import factory as _factory
1✔
11

12

13
class PluginComponentCreationError(Exception):
1✔
14
    pass
1✔
15

16

17
class PluginComponent(
1✔
18
    _bip.BlockItemHasInternalPiping, _gimx.SvgBlockItemGraphicItemMixin
19
):
20
    def __init__(self, trnsysType: str, editor, displayName: str) -> None:
1✔
21
        super().__init__(trnsysType, editor, displayName)
×
22

23
        factory = _factory.Factory.createDefault()
×
24
        pluginResult = factory.create(trnsysType)
×
25

26
        if _res.isError(pluginResult):
×
27
            errorMessage = _res.error(pluginResult).message
×
28
            raise PluginComponentCreationError(errorMessage)
×
29
        plugin = _res.value(pluginResult)
×
30

NEW
31
        createdInternalPiping = (
×
32
            plugin.internalPipingFactory.createInternalPiping(self)
33
        )
34

35
        self.inputs.extend(createdInternalPiping.inputPorts)
×
36
        self.outputs.extend(createdInternalPiping.outputPorts)
×
37
        self._internalPiping = createdInternalPiping.internalPiping
×
38

39
        self._imageAccessor = plugin.graphics.accessor
×
40
        self.w = plugin.graphics.size.width
×
41
        self.h = plugin.graphics.size.height
×
42

43
        self.changeSize()
×
44

45
    def getDisplayName(self) -> str:
1✔
46
        return self.displayName
×
47

48
    @_tp.override
1✔
49
    def _getImageAccessor(self) -> _img.SvgImageAccessor:
1✔
50
        return self._imageAccessor
×
51

52
    def getInternalPiping(self) -> _ip.InternalPiping:
1✔
53
        return self._internalPiping
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc