Mercurial > libervia-backend
comparison sat_frontends/jp/cmd_input.py @ 4037:524856bd7b19
massive refactoring to switch from camelCase to snake_case:
historically, Libervia (SàT before) was using camelCase as allowed by PEP8 when using a
pre-PEP8 code, to use the same coding style as in Twisted.
However, snake_case is more readable and it's better to follow PEP8 best practices, so it
has been decided to move on full snake_case. Because Libervia has a huge codebase, this
ended with a ugly mix of camelCase and snake_case.
To fix that, this patch does a big refactoring by renaming every function and method
(including bridge) that are not coming from Twisted or Wokkel, to use fully snake_case.
This is a massive change, and may result in some bugs.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 08 Apr 2023 13:54:42 +0200 |
parents | be6d91572633 |
children | 4b842c1fb686 |
comparison
equal
deleted
inserted
replaced
4036:c4464d7ae97b | 4037:524856bd7b19 |
---|---|
115 self.parser.add_argument("command", nargs=argparse.REMAINDER) | 115 self.parser.add_argument("command", nargs=argparse.REMAINDER) |
116 | 116 |
117 def opt(self, type_): | 117 def opt(self, type_): |
118 return lambda s: (type_, s) | 118 return lambda s: (type_, s) |
119 | 119 |
120 def addValue(self, value): | 120 def add_value(self, value): |
121 """add a parsed value according to arguments sequence""" | 121 """add a parsed value according to arguments sequence""" |
122 self._values_ori.append(value) | 122 self._values_ori.append(value) |
123 arguments = self.args.arguments | 123 arguments = self.args.arguments |
124 try: | 124 try: |
125 arg_type, arg_name = arguments[self.args_idx] | 125 arg_type, arg_name = arguments[self.args_idx] |
327 for idx, row in enumerate(reader): | 327 for idx, row in enumerate(reader): |
328 try: | 328 try: |
329 if idx < self.args.row: | 329 if idx < self.args.row: |
330 continue | 330 continue |
331 for value in row: | 331 for value in row: |
332 self.addValue(value) | 332 self.add_value(value) |
333 await self.runCommand() | 333 await self.runCommand() |
334 except exceptions.CancelError: | 334 except exceptions.CancelError: |
335 # this row has been cancelled, we skip it | 335 # this row has been cancelled, we skip it |
336 continue | 336 continue |
337 | 337 |