Loading CHANGELOG.md +1 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ - Added support for Python 2.7. - Added a fallback mechanism (opt-in) for missing dependencies. - Added `search` command. ### Changes Loading poetry/console/application.py +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ from .commands import PublishCommand from .commands import RemoveCommand from .commands import RunCommand from .commands import ScriptCommand from .commands import SearchCommand from .commands import ShowCommand from .commands import UpdateCommand from .commands import VersionCommand Loading Loading @@ -100,6 +101,7 @@ class Application(BaseApplication): RemoveCommand(), RunCommand(), ScriptCommand(), SearchCommand(), ShowCommand(), UpdateCommand(), VersionCommand(), Loading poetry/console/commands/__init__.py +1 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ from .publish import PublishCommand from .remove import RemoveCommand from .run import RunCommand from .script import ScriptCommand from .search import SearchCommand from .show import ShowCommand from .update import UpdateCommand from .version import VersionCommand poetry/console/commands/search.py 0 → 100644 +35 −0 Original line number Diff line number Diff line from .command import Command class SearchCommand(Command): """ Searches for packages on remote repositories. search { tokens* : The tokens to search for. } { --N|only-name : Search only in name. } """ def handle(self): from poetry.repositories.base_repository import BaseRepository flags = BaseRepository.SEARCH_FULLTEXT if self.option('only-name'): flags = BaseRepository.SEARCH_FULLTEXT results = self.poetry.pool.search(self.argument('tokens'), flags) for result in results: self.line('') name = '<info>{}</>'.format( result.name ) name += ' (<comment>{}</>)'.format(result.version) self.line(name) if result.description: self.line( ' {}'.format(result.description) ) poetry/repositories/legacy_repository.py +4 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,10 @@ class LegacyRepository(PyPiRepository): } }) @property def name(self): return self._name def find_packages(self, name, constraint=None, extras=None): packages = [] Loading Loading
CHANGELOG.md +1 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ - Added support for Python 2.7. - Added a fallback mechanism (opt-in) for missing dependencies. - Added `search` command. ### Changes Loading
poetry/console/application.py +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ from .commands import PublishCommand from .commands import RemoveCommand from .commands import RunCommand from .commands import ScriptCommand from .commands import SearchCommand from .commands import ShowCommand from .commands import UpdateCommand from .commands import VersionCommand Loading Loading @@ -100,6 +101,7 @@ class Application(BaseApplication): RemoveCommand(), RunCommand(), ScriptCommand(), SearchCommand(), ShowCommand(), UpdateCommand(), VersionCommand(), Loading
poetry/console/commands/__init__.py +1 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ from .publish import PublishCommand from .remove import RemoveCommand from .run import RunCommand from .script import ScriptCommand from .search import SearchCommand from .show import ShowCommand from .update import UpdateCommand from .version import VersionCommand
poetry/console/commands/search.py 0 → 100644 +35 −0 Original line number Diff line number Diff line from .command import Command class SearchCommand(Command): """ Searches for packages on remote repositories. search { tokens* : The tokens to search for. } { --N|only-name : Search only in name. } """ def handle(self): from poetry.repositories.base_repository import BaseRepository flags = BaseRepository.SEARCH_FULLTEXT if self.option('only-name'): flags = BaseRepository.SEARCH_FULLTEXT results = self.poetry.pool.search(self.argument('tokens'), flags) for result in results: self.line('') name = '<info>{}</>'.format( result.name ) name += ' (<comment>{}</>)'.format(result.version) self.line(name) if result.description: self.line( ' {}'.format(result.description) )
poetry/repositories/legacy_repository.py +4 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,10 @@ class LegacyRepository(PyPiRepository): } }) @property def name(self): return self._name def find_packages(self, name, constraint=None, extras=None): packages = [] Loading