Closed nopnop2002 closed 4 years ago
Each of the files are opened in a context manager, so they're closed automatically after the read or write. You're right that they will be reopened and closed as many times as the properties are modified, but the contributor likely designed the module assuming infrequent modifications.
I'm open to modifications if there is a compelling reason to keep them open and rewind after reading/writing.
GPIO class maintains open file descriptor as self._fd. also I2C class maintains open file descriptor as self._fd. but PWM class don't maintains open file descriptor of /sys/class/pwm/pwmchipX/pwmX, and It open file Each method(period, frequency,polarity). So It open /sys/class/pwm/pwmchipX/pwmX many times. And never close file system. Is this right?