Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #17

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Fixes #17

wants to merge 4 commits into from

Conversation

KOLANICH
Copy link

@KOLANICH KOLANICH commented Jun 7, 2018

No description provided.

Copy link
Owner

@kewisch kewisch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the work you have put in on this, exciting to see contributesions. I haven't had a chance to test this yet, but a few code comments while you wait:

@@ -236,7 +239,7 @@ def cmd_adminstatus(handler, amo, args):

if args.file:
print("Last chance to bail out before changes are made (Ctrl+C to quit, enter to continue)")
raw_input()
six.moves.input()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You use six.moves.input() here, but input() in other places. Any specific reason?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No specific reason, it would crash if control reached there. I just forgot to change there. In fact the lib is pretty untested, I just ran it and fixed where I get exceptions, for now I haven't ran it further than the first input (I wonder if I really need an API key just to download the info about addons). Anyway, you can cherry-pick the first 2 commits, if they seem good to you.

pyamo/review.py Outdated
"application/x-7z-compressed": SevenZFile,
"application/zip": ZipFile
}
def getArchiveCtor(path):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about something like this too. I'm fine with removing the magic code alltogether and only using the manual method. Make sure to adapt setup.py as well.

@@ -207,7 +227,7 @@ def __init__(self, parent, head, body):

def _init_head(self, head):
args = head.iterchildren().next().text.encode('utf-8').strip().split(" ")
_, self.version, _, month, day, year = filter(None, args) # pylint: disable=bad-builtin
_, self.version, _, month, day, year = [_f for _f in args if _f] # pylint: disable=bad-builtin
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove disable=bad-builtin with this now, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know, I'm unfamiliar with pylint.

@@ -3,13 +3,14 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Portions Copyright (C) Philipp Kewisch, 2015-2016

from __future__ import print_function
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep this if possible.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have missed this fixing after 2to3, thank you.

setup.cfg Outdated
packages = pyamo
setup_requires = setuptools_scm;
test_suite = tests.test
dependency_links = git+https://github.com/benjaminp/six.git#egg=six, git+https://github.com/mozilla/PyFxA.git#egg=PyFxA, git+https://github.com/ahupp/python-magic.git, git+https://github.com/requests/requests.git#egg=requests, git+https://github.com/scrapy/cssselect.git#egg=cssselect, git+https://github.com/druths/arghandler.git#egg=arghandler, git+https://github.com/regebro/tzlocal.git#egg=tzlocal, git+https://github.com/dateutil/dateutil.git#egg=python-dateutil
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this multiline? Will this cause dependencies to be installed from github, or will they still be taken from pypi?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact I have not managed make this work. I want the dependencies be installed from GitHub, but they still don't, don't know why. Even passing flags to pip doesn't help. We need to check if they have disabled this behavior. Even if the links are useless for auto install, I guess storing them here is useful anyway: I won't have to crawl the inet for the deps git repos the next time.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to keep the dependencies on pypi.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

pyamo/review.py Outdated
def getArchiveCtor(path):
return archiveCtorMapping[magic.from_file(path, mime=True)]
except:
archiveCtorMapping={
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch, have forgotten to remove this.

pyamo/utils.py Outdated
@@ -207,7 +208,7 @@ def find_binary(name):

# find the default executable from the windows registry
try:
import _winreg
import winreg
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also need to fix this with six

@KOLANICH KOLANICH force-pushed the Fixes branch 3 times, most recently from f6f1259 to 042ef8b Compare June 8, 2018 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants