Minege/eSSP

Comply with PEP8

Closed this issue · 0 comments

0xjac commented

The code has multiple PEP8 violations to be fixed, including but not limited to:

  • two blank lines before a class declaration (L12, L17, L25, L31, L35)

  • class name should use CamelCase (L12, L17, L25, L31, L35)

  • use new style classes: class ClassName(object): (L35)

  • 2 spaces before comment: # (L44 and more)

  • block comment should start with a pound and a space after it (L48, L91, L199, L204, L315)

  • missing space after , (L98, L220, L230 and more)

  • redundant parenthesis (L220, L224, L227, L230)

  • missing spaces around operators: 3*x -> 3 * x, self.actions+="y" -> self.actions += 'y'

I'm also leaving here a couple other minor issues which are not exactly PEP8:

  • use .format instead of % for string formatting.

  • cannot return value from init (L52, L66, L72, L95, L101)

    If you need a catastrophic failure here, raise an exception, preferably a custom one for clarity.

  • use setup_req.UnitType in {0x06, 0x07} instead of or L90

    Using set membership will make your condition shorter and more readable, esp. if you need to add another value
    later on.

  • In my opinion I would remove the t1 variable or if you want to keep it, use a clearer name such as loop_thread (L102)

  • variable ACTION_SIZE should be lowercase. (L116)

    This is irrelevant once #3 is fixed