View Single Post
Old 10-16-2014, 07:02 AM   #1060
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,961
Karma: 6361444
Join Date: Nov 2009
Device: many
Hi,
The code to allow KindleUnpack to work on *BOTH* Python 2.7 and Python 3.4 is incomplete, but runnable from the command line. It is in the python2and3 branch.

And yes 2to3 will scream at it but that is expected and does actually run on both.

I will run reindent.py on the master to clean up most of the spacing issues. It was run but only the python2and3 branch.

That was done so all serious whitespace issues should be taken care of.

As for flake8 - it is simply a style enforcer. And McCabe's complexity analysis is for the birds as well. You can tell if code is maintainable by simply reading it.

For example numerous "errors" in mobi_header.py are:

Code:
    id_map_strings = {
        1 : 'Drm Server Id (1)',
        2 : 'Drm Commerce Id (2)',
        3 : 'Drm Ebookbase Book Id(3)',
        100 : 'Creator_(100)',
        101 : 'Publisher_(101)',
        102 : 'Imprint_(102)',
        103 : 'Description_(103)',
        104 : 'ISBN_(104)',
        105 : 'Subject_(105)',
        106 : 'Published_(106)',
simply the space before or after the ":' in the dictionary initializer.

Sorry but that's not gonna change!

The change itself would be meaningless (no impact on pyc execution) and the spacing helps to make things look cleaner.

I *will* look at the unused variables and more serious cdll issues and other issues that flake8 picks up but style only changes in whitespace or "line too long" changes will be ignored.

So please don't bother to offer pull requests for line length issues or whitespace issues that are not related to indentation issues. Only changes that actually or potentially impact functionality will considered.

That should bring that 2188 down to a more reasonable level!

Thanks,

KevinH

Quote:
Originally Posted by AcidWeb View Post
eureka beat me to it. I also was planning to bring up this topic.

Today I will make Pull Request to Python3 branch with cleaned/PEP8 compliant code.
At the same time KevinH will have chance to look how GitHub support code contributions.

Edit:
I presume that Python3 branch is not yet ready? Because I see multiple places where sytax not supported by Python 3.4 is used.

Edit 2:
2188 Python 2.x PEP8 style violations. *Cough*. That pull request might not be ready today :-P

Last edited by KevinH; 10-16-2014 at 08:08 AM.
KevinH is offline   Reply With Quote