Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Mirror packages requested with underscores in names #10

Merged
merged 2 commits into from Apr 17, 2013
Merged

Mirror packages requested with underscores in names #10

merged 2 commits into from Apr 17, 2013

Conversation

fizyk
Copy link
Contributor

@fizyk fizyk commented Apr 15, 2013

fixes #9

@mardiros
Copy link
Owner

Maybe i miss something but:

import xmlrpclib
api = xmlrpclib.ServerProxy('http://pypi.python.org/pypi')

api.search({'name': 'sphinx_bootstrap_theme'})
[{'_pypi_ordering': 110, 'version': '0.2.1', 'name': 'sphinx-bootstrap-theme', 'summary': 'Sphinx Bootstrap Theme.'}]

api.search({'name': 'pyramid_celery'})
[{'_pypi_ordering': 14, 'version': '1.3', 'name': 'pyramid_celery', 'summary': 'Celery integration with pyramid'}]

So this will fix your package, but will break mine :)

I think we should check the both. (And yes, this is crazy...)

So, please just replace

             search_result = [p for p in search_result
                              if p['name'].lower() == package_name] 

By

             search_result = [p for p in search_result
                              if p['name'].lower().replace('_', '-') == package_name] 

To handle the both.

@fizyk
Copy link
Contributor Author

fizyk commented Apr 16, 2013

true, thank god for Code review.

mardiros pushed a commit that referenced this pull request Apr 17, 2013
Mirror packages requested with underscores in names
@mardiros mardiros merged commit 82464ec into mardiros:master Apr 17, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't mirror sphinx_bootstrap_theme
2 participants