Merge lp:~matiasb/click-toolbelt/info-channels into lp:click-toolbelt

Proposed by Matias Bordese
Status: Merged
Approved by: Matias Bordese
Approved revision: 35
Merged at revision: 37
Proposed branch: lp:~matiasb/click-toolbelt/info-channels
Merge into: lp:click-toolbelt
Diff against target: 88 lines (+30/-1)
3 files modified
README (+21/-0)
click_toolbelt/info.py (+4/-1)
click_toolbelt/tests/test_info.py (+5/-0)
To merge this branch: bzr merge lp:~matiasb/click-toolbelt/info-channels
Reviewer Review Type Date Requested Status
Ricardo Kirkner (community) Approve
Review via email: mp+275207@code.launchpad.net

Commit message

Added channel info command.

To post a comment you must log in.
Revision history for this message
Ricardo Kirkner (ricardokirkner) wrote :

LGTM

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

The attempt to merge lp:~matiasb/click-toolbelt/info-channels into lp:click-toolbelt failed. Below is the output from the failed tests.

New python executable in .env/bin/python
Installing distribute.............................................................................................................................................................................................done.
Installing pip...............done.
Downloading/unpacking cliff (from -r requirements.txt (line 1))
  Running setup.py egg_info for package cliff

    Installed /mnt/tarmac/cache/click-toolbelt/trunk/.env/build/cliff/pbr-1.8.1-py2.7.egg
    [pbr] Processing SOURCES.txt
    warning: LocalManifestMaker: standard file '-c' not found

    warning: no previously-included files found matching '.gitignore'
    warning: no previously-included files found matching '.gitreview'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no files found matching '*.rst' under directory 'docs'
    warning: no files found matching '*.py' under directory 'docs'
    warning: no files found matching '*.html' under directory 'docs'
    warning: no files found matching '*.css' under directory 'docs'
    warning: no files found matching '*.js' under directory 'docs'
    warning: no files found matching '*.png' under directory 'docs'
    warning: no files found matching '*.txt' under directory 'docs'
    warning: no files found matching '*.py' under directory 'tests'
Downloading/unpacking pyxdg (from -r requirements.txt (line 2))
  Running setup.py egg_info for package pyxdg

Downloading/unpacking requests (from -r requirements.txt (line 3))
  Running setup.py egg_info for package requests

Downloading/unpacking requests-oauthlib (from -r requirements.txt (line 4))
  Running setup.py egg_info for package requests-oauthlib

Downloading/unpacking ssoclient (from -r requirements.txt (line 5))
  Downloading ssoclient-2.1.tar.gz
  Running setup.py egg_info for package ssoclient

Downloading/unpacking mock (from -r requirements.txt (line 6))
  Running setup.py egg_info for package mock
    mock requires setuptools>=17.1. Aborting installation
    Complete output from command python setup.py egg_info:
    mock requires setuptools>=17.1. Aborting installation

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /mnt/tarmac/cache/click-toolbelt/trunk/.env/build/mock
Storing complete log in /mnt/tarmac/.pip/pip.log

make: *** [env] Error 1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2015-09-23 12:40:58 +0000
3+++ README 2015-10-21 16:21:36 +0000
4@@ -48,6 +48,7 @@
5
6 - tagline: A one line summary for the app
7 - department: The app's category name (see `Department`_)
8+- channel: The upload target channel name (see `Channel`_). If omitted, 'stable' is assumed.
9 - support_url: A URL users can go to for support for this application. Allows http(s): and mailto: schemes
10 - license: The license under which the app will be released (see `License`_)
11 - icon_256 (or icon): The path to a local file to be uploaded as the icon for the application; the icon must be 256x256 px in size
12@@ -62,6 +63,7 @@
13
14 For a new version upload, the ``metadata_file`` file will only be scanned for the following fields:
15
16+- channel: The upload target channel name (see `Channel`_). If omitted, 'stable' is assumed.
17 - changelog: A description of the changes included since the last upload
18
19
20@@ -96,6 +98,12 @@
21 $ click-toolbelt info country
22
23
24+Get the list of valid channels
25+::
26+
27+ $ click-toolbelt info channel
28+
29+
30 Get the list of valid departments
31 ::
32
33@@ -150,3 +158,16 @@
34 - "GB" (United Kingdom)
35 - "US" (United States)
36 - "UY" (Uruguay)
37+
38+
39+Channel
40+-------
41+
42+Valid values can be obtained via the ``info`` command (or it's equivalent api call).
43+
44+Examples
45+........
46+
47+ - "stable"
48+ - "proposed"
49+ - "alpha"
50
51=== modified file 'click_toolbelt/info.py'
52--- click_toolbelt/info.py 2015-04-20 16:18:01 +0000
53+++ click_toolbelt/info.py 2015-10-21 16:21:36 +0000
54@@ -14,7 +14,7 @@
55
56 class Info(Command):
57 log = logging.getLogger(__name__)
58- topics = ['version', 'department', 'license', 'country']
59+ topics = ['version', 'department', 'license', 'country', 'channel']
60
61 def get_parser(self, prog_name):
62 parser = super(Info, self).get_parser(prog_name)
63@@ -45,6 +45,9 @@
64 def get_country_info(self, data):
65 return data.get('country')
66
67+ def get_channel_info(self, data):
68+ return data.get('channel')
69+
70 def get_topic_data(self, api_data, topic):
71 method = getattr(self, 'get_{}_info'.format(topic))
72 return method(api_data)
73
74=== modified file 'click_toolbelt/tests/test_info.py'
75--- click_toolbelt/tests/test_info.py 2015-04-20 16:18:01 +0000
76+++ click_toolbelt/tests/test_info.py 2015-10-21 16:21:36 +0000
77@@ -111,6 +111,11 @@
78 data = {'country': expected}
79 self._test_take_action_with_topic(data, 'country', expected)
80
81+ def test_take_action_with_channel(self):
82+ expected = ['stable', 'beta']
83+ data = {'channel': expected}
84+ self._test_take_action_with_topic(data, 'channel', expected)
85+
86 def test_take_action_with_error(self):
87 with patch.object(self.command, 'get_info') as mock_get_info:
88 mock_get_info.return_value = {

Subscribers

People subscribed via source and target branches