PEP8 code cleanup support offer

Asked by Ivan Radic

Hi,

I browsed the code on github and noticed a relatively high number of PEP8 violations in Python files. Do you guys need help cleaning up that stuff? I could do it if you wish.

Most of the violations that PyCharm IDE reports are relatively simple problems: use of tabs, lines too long (>120 chars), variable names in Camelcase, variable names that hide built-in keywords (dir, type, file etc..., these can be suffixed by an underscore dir_, type_, file_), unused variables or arguments, use of unnecessary brackets in if statements ( "if (condition): pass", instead of "if condition: pass" ), vertical spacing gets too wide at times, and so on... these are relatively boring "no-brainers", that I can do them even without understanding the code. This stuff could go into one commit, it can be summed up as only white space changes and variable rename operations.

Into second commit I could put basic stuff that touches code execution logic. Like there are some issues that are not exactly errors, but should be reformatted anyway: "if not var in container:" should be "if var not in container:" I am quite experienced with Python, so this should be done without any errors, but just in case I do make an error and this commit should be reversed, it would be smart to separate it from first commit that does not touch code execution logic.

I might need some help with second commit. For example which Python version are you using (2 or 3)? This affects things like "super()" syntax, or class definition (should they subclass "object"), or I noticed some places where methods are defined like this:

# not the real code, just a simplification !!

def method(self, agr1, *args):
    return arg1 ** 2

In this case *args tuple is useless, and it might be a coding error, but it also might be put in there as a protection in case "method" is called with more that one argument. I can prepare a list of such ambiguous code samples, and you can decide what to do in each case. Small refactoring would also be needed in cases where "private" attributes (private in the sense that they names start with underscore) are accessed directly, or in case where data attributes are created outside of __init__(self).

In case you are interested, let me know, I could start this weekend.

There is one problem though, I know nothing of launchpad or its revision system. Could you give me few pointers how to get the latest code from launchpad (if github mirror is not synchronized on daily bases), and how do I push the code back to you?

Thank you and best regards,
Ivan

Question information

Language:
English Edit question
Status:
Answered
For:
OpenShot Video Editor Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Olivier Girard (eolinwen) said :
#1

Hi Ivan,

>>>Do you guys need help cleaning up that stuff? I could do it if you wish.

Yes you can do that.

>>>There is one problem though, I know nothing of launchpad or its revision system. Could you give me few pointers how to get the latest code from launchpad (if github mirror is not synchronized on daily bases), and how do I push the code back to you?

To my mind I think that you can do that on github but.
Only Jonathan can answer to this question. Send him an email at this adress : http://www.openshot.org/developers/
Like this could get a "fast answer" I hope.... You 'll be more lucky than me.

Thanks a lot to help us.

Cheers.

Revision history for this message
Ivan Radic (udlv20) said :
#2

Message is sent to Jonathan.
Thanks for pointers, Oliver.

Best regards,
Ivan

Revision history for this message
Olivier Girard (eolinwen) said :
#3

Great Ivan.

Best regards,
Olivier.

2015-09-17 17:12 GMT+02:00 Ivan Radic <email address hidden>
:

> Question #271174 on OpenShot Video Editor changed:
> https://answers.launchpad.net/openshot/+question/271174
>
> Ivan Radic posted a new comment:
> Message is sent to Jonathan.
> Thanks for pointers, Oliver.
>
> Best regards,
> Ivan
>
> --
> You received this question notification because you are an answer
> contact for OpenShot Video Editor.
>

--
Olivier
Cenwen un elfe sur la banquise/ an elve on the ice
Mon blog perso sur le multimédia, Ubuntu, Linux et OpenShot :
http://linuxevolution.wordpress.com/
Le forum d'Openshot où vous me trouverez : http://openshotusers.com/
http://openshotusers.com/forum/index.php
Nothing is lost until the last second.
The family motto : When we want, we can.
Astuces, Actualités, Logiciels, bref sur tout ce que je ne fais d'articles
dessus Google+ <https://plus.google.com/u/0/111472725110173916234/posts>

Can you help with this problem?

Provide an answer of your own, or ask Ivan Radic for more information if necessary.

To post a message you must log in.