Skip to content

Commit

Permalink
Fixed some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankpatibandla committed Oct 18, 2023
1 parent 63b2dbe commit f015da3
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 12 deletions.
5 changes: 2 additions & 3 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[MASTER]

max-line-length = 120

disable = C0114, C0115, C0116, R0903, C0415, R1705, R0913, W1203, R1729, E1120, E1123, C0209, R1710, W0621, C0121,
disable = C0114, C0115, C0116, R0903, C0415, R1705, R0913, W1203, R1729, E1120, E1123, C0209, R1710, W0621, C0121,
W0614, W0401, W1202, C0117, W0718, R0205, R0402, R0914, R1725, R1735, C0411, W0237, W0702, W0223, W0613,
W0108, R0912, R0911, W0511, E1136, R0902, W0611, C0412, C0103, C0301, R1732, R0915, W1514, R1718, W1510,
E0602, W1309, C0325, E1101, R1714, R0916, W0719, R1734, E1133, W1201, W0107, W3101, W0640, C0201, W1113,
W0246, W0622, W0221, E1111, R1720, W0221, R1723, E0102, W0201, E0203, E0401, W0602, W0212, W0707, R0904,
W0101, C0302, E0110, W0603, R1701, W0106, R1721
W0101, C0302, E0110, W0603, R1701, W0106, R1721, W0601,
2 changes: 1 addition & 1 deletion pros/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_version():
module = pros.cli.main.__name__
for dist in pkg_resources.working_set:
scripts = dist.get_entry_map().get('console_scripts') or {}
for script_name, entry_point in iter(scripts.items()):
for _, entry_point in iter(scripts.items()):
if entry_point.module_name == module:
ver = dist.version
if ver is not None:
Expand Down
1 change: 0 additions & 1 deletion pros/conductor/project/ProjectTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def execute(self, conductor: c.Conductor, project: c.Project):
raise e
else:
ui.logger(__name__).warning(str(e))
return None

def describe(self, conductor: c.Conductor, project: c.Project):
action = project.get_template_actions(conductor.resolve_template(self.template))
Expand Down
2 changes: 1 addition & 1 deletion pros/conductor/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def find_project(path: str, recurse_times: int = 10):
if os.path.isfile(path):
path = os.path.dirname(path)
if os.path.isdir(path):
for n in range(recurse_times):
for _ in range(recurse_times):
if path is not None and os.path.isdir(path):
files = [f for f in os.listdir(path)
if os.path.isfile(os.path.join(path, f)) and f.lower() == 'project.pros']
Expand Down
2 changes: 1 addition & 1 deletion pros/ga/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def send(self,action):
timeout=5.0)
self.pendingRequests.append(future)

except Exception as e:
except Exception:
from pros.cli.common import logger
logger(__name__).warning("Unable to send analytics. Do you have a stable internet connection?", extra={'sentry': False})

Expand Down
2 changes: 1 addition & 1 deletion pros/serial/devices/vex/crc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(self, size: int, polynomial: int):

for i in range(256):
crc_accumulator = i << (self._size - 8)
for j in range(8):
for _ in range(8):
if crc_accumulator & (1 << (self._size - 1)):
crc_accumulator = (crc_accumulator << 1) ^ self._polynomial
else:
Expand Down
5 changes: 2 additions & 3 deletions pros/serial/devices/vex/v5_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ def upload_project(self, project: Project, **kwargs):

def generate_ini_file(self, remote_name: str = None, slot: int = 0, ini: ConfigParser = None, **kwargs):
project_ini = ConfigParser()
from semantic_version import Spec
default_icon = 'USER902x.bmp' if Spec('>=1.0.0-22').match(self.status['cpu0_version']) else 'USER999x.bmp'
project_ini['project'] = {
'version': str(kwargs.get('ide_version') or get_version()),
Expand Down Expand Up @@ -612,7 +611,7 @@ def read_ini(self, remote_name: str) -> Optional[ConfigParser]:
rx_io.seek(0, 0)
config.read_string(rx_io.read().decode('ascii'))
return config
except VEXCommError as e:
except VEXCommError:
return None

@retries
Expand Down Expand Up @@ -918,7 +917,7 @@ def kv_write(self, kv: str, payload: Union[Iterable, bytes, bytearray, str]):
payload = payload.encode(encoding='ascii')
tx_fmt =f'<{len(encoded_kv)}s{len(payload)}s'
tx_payload = struct.pack(tx_fmt, encoded_kv, payload)
ret = self._txrx_ext_packet(0x2f, tx_payload, 1, check_length=False, check_ack=True)
self._txrx_ext_packet(0x2f, tx_payload, 1, check_length=False, check_ack=True)
logger(__name__).debug('Completed ext 0x2f command')
return payload

Expand Down
2 changes: 1 addition & 1 deletion pros/serial/ports/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import lru_cache

from pros.common import logger
from serial.tools import list_ports as list_ports
from serial.tools import list_ports

from .base_port import BasePort, PortConnectionException, PortException
from .direct_port import DirectPort
Expand Down

0 comments on commit f015da3

Please sign in to comment.