Merge lp:~james-w/launchpad/export-code-import into lp:launchpad
- export-code-import
- Merge into devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Tim Penhey | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp:~james-w/launchpad/export-code-import | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
330 lines (+142/-45) 11 files modified
lib/canonical/launchpad/doc/canonical_url_examples.txt (+10/-0) lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+2/-0) lib/lp/code/browser/branch.py (+5/-0) lib/lp/code/browser/codeimport.py (+3/-3) lib/lp/code/browser/configure.zcml (+5/-0) lib/lp/code/doc/codeimport.txt (+4/-4) lib/lp/code/interfaces/branch.py (+4/-2) lib/lp/code/interfaces/codeimport.py (+48/-36) lib/lp/code/interfaces/webservice.py (+1/-0) lib/lp/code/stories/webservice/xx-branch.txt (+1/-0) lib/lp/code/stories/webservice/xx-code-import.txt (+59/-0) |
||||
To merge this branch: | bzr merge lp:~james-w/launchpad/export-code-import | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Penhey (community) | Approve | ||
Review via email: mp+21472@code.launchpad.net |
Commit message
Expose the main code import attributes read only.
Description of the change
This exports ICodeImport.
It's not intended to be all-singing, all-dancing, just export
the objects, we can do more in future branches.
Thanks,
James
Francis J. Lacoste (flacoste) wrote : | # |
On March 16, 2010, James Westby wrote:
+ owner = exported(
> + PublicPersonChoice(
> + title=_('Owner'), required=True, readonly=False,
> + vocabulary=
> + description=_("The community contact for this import.")))
>
> + review_status = exported(
> + Choice(
> + title=_("Review Status"), vocabulary=
> + default=
> + description=
> reviewed." + " Only reviewed imports are processed.")))
> +
Do we know if the security wrapper were properly defined for the exported field?
> + date_last_
> + Datetime(
>
This should probably be a readonly field?
--
Francis J. Lacoste
<email address hidden>
James Westby (james-w) wrote : | # |
> On March 16, 2010, James Westby wrote:
> + owner = exported(
> > + PublicPersonChoice(
> > + title=_('Owner'), required=True, readonly=False,
> > + vocabulary=
> > + description=_("The community contact for this import.")))
> >
>
> > + review_status = exported(
> > + Choice(
> > + title=_("Review Status"), vocabulary=
> > + default=
> > + description=
> > reviewed." + " Only reviewed imports are processed.")))
> > +
>
> Do we know if the security wrapper were properly defined for the exported
> field?
I don't know what that means, so probably not.
> > + date_last_
> > + Datetime(
> >
>
> This should probably be a readonly field?
It is in the latest diff.
Thanks,
James
Preview Diff
1 | === modified file 'lib/canonical/launchpad/doc/canonical_url_examples.txt' | |||
2 | --- lib/canonical/launchpad/doc/canonical_url_examples.txt 2010-03-12 18:28:28 +0000 | |||
3 | +++ lib/canonical/launchpad/doc/canonical_url_examples.txt 2010-03-17 21:52:39 +0000 | |||
4 | @@ -356,6 +356,16 @@ | |||
5 | 356 | http://code.launchpad.dev/~name12/gnome-terminal/main/+merge/.../comments/... | 356 | http://code.launchpad.dev/~name12/gnome-terminal/main/+merge/.../comments/... |
6 | 357 | 357 | ||
7 | 358 | 358 | ||
8 | 359 | == Code Imports == | ||
9 | 360 | |||
10 | 361 | Code imports have a canonical URL which is a subordinate of the branch | ||
11 | 362 | that they import to. | ||
12 | 363 | |||
13 | 364 | >>> from lp.code.interfaces.codeimport import ICodeImportSet | ||
14 | 365 | >>> code_import = getUtility(ICodeImportSet).get(1) | ||
15 | 366 | >>> print canonical_url(code_import) | ||
16 | 367 | http://code.launchpad.dev/~vcs-imports/gnome-terminal/import/+code-import | ||
17 | 368 | |||
18 | 359 | == Specifications == | 369 | == Specifications == |
19 | 360 | 370 | ||
20 | 361 | >>> from canonical.launchpad.interfaces import ISpecificationSet | 371 | >>> from canonical.launchpad.interfaces import ISpecificationSet |
21 | 362 | 372 | ||
22 | === modified file 'lib/canonical/launchpad/interfaces/_schema_circular_imports.py' | |||
23 | --- lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-03-16 05:09:55 +0000 | |||
24 | +++ lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-03-17 21:52:39 +0000 | |||
25 | @@ -40,6 +40,7 @@ | |||
26 | 40 | from lp.code.interfaces.branch import IBranch | 40 | from lp.code.interfaces.branch import IBranch |
27 | 41 | from lp.code.interfaces.branchmergeproposal import IBranchMergeProposal | 41 | from lp.code.interfaces.branchmergeproposal import IBranchMergeProposal |
28 | 42 | from lp.code.interfaces.branchsubscription import IBranchSubscription | 42 | from lp.code.interfaces.branchsubscription import IBranchSubscription |
29 | 43 | from lp.code.interfaces.codeimport import ICodeImport | ||
30 | 43 | from lp.code.interfaces.codereviewcomment import ICodeReviewComment | 44 | from lp.code.interfaces.codereviewcomment import ICodeReviewComment |
31 | 44 | from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference | 45 | from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference |
32 | 45 | from lp.code.interfaces.diff import IPreviewDiff | 46 | from lp.code.interfaces.diff import IPreviewDiff |
33 | @@ -95,6 +96,7 @@ | |||
34 | 95 | patch_plain_parameter_type( | 96 | patch_plain_parameter_type( |
35 | 96 | IBranch, 'setTarget', 'source_package', ISourcePackage) | 97 | IBranch, 'setTarget', 'source_package', ISourcePackage) |
36 | 97 | patch_reference_property(IBranch, 'sourcepackage', ISourcePackage) | 98 | patch_reference_property(IBranch, 'sourcepackage', ISourcePackage) |
37 | 99 | patch_reference_property(IBranch, 'code_import', ICodeImport) | ||
38 | 98 | 100 | ||
39 | 99 | IBranch['spec_links'].value_type.schema = ISpecificationBranch | 101 | IBranch['spec_links'].value_type.schema = ISpecificationBranch |
40 | 100 | IBranch['subscribe'].queryTaggedValue( | 102 | IBranch['subscribe'].queryTaggedValue( |
41 | 101 | 103 | ||
42 | === modified file 'lib/lp/code/browser/branch.py' | |||
43 | --- lib/lp/code/browser/branch.py 2010-02-24 13:37:51 +0000 | |||
44 | +++ lib/lp/code/browser/branch.py 2010-03-17 21:52:39 +0000 | |||
45 | @@ -181,6 +181,11 @@ | |||
46 | 181 | if proposal.id == id: | 181 | if proposal.id == id: |
47 | 182 | return proposal | 182 | return proposal |
48 | 183 | 183 | ||
49 | 184 | @stepto("+code-import") | ||
50 | 185 | def traverse_code_import(self): | ||
51 | 186 | """Traverses to the `ICodeImport` for the branch.""" | ||
52 | 187 | return self.context.code_import | ||
53 | 188 | |||
54 | 184 | 189 | ||
55 | 185 | class BranchEditMenu(NavigationMenu): | 190 | class BranchEditMenu(NavigationMenu): |
56 | 186 | """Edit menu for IBranch.""" | 191 | """Edit menu for IBranch.""" |
57 | 187 | 192 | ||
58 | === modified file 'lib/lp/code/browser/codeimport.py' | |||
59 | --- lib/lp/code/browser/codeimport.py 2010-03-08 19:27:29 +0000 | |||
60 | +++ lib/lp/code/browser/codeimport.py 2010-03-17 21:52:39 +0000 | |||
61 | @@ -435,9 +435,9 @@ | |||
62 | 435 | class EditCodeImportForm(Interface): | 435 | class EditCodeImportForm(Interface): |
63 | 436 | """The fields presented on the form for editing a code import.""" | 436 | """The fields presented on the form for editing a code import.""" |
64 | 437 | 437 | ||
68 | 438 | use_template( | 438 | url = copy_field(ICodeImport['url'], readonly=False) |
69 | 439 | ICodeImport, | 439 | cvs_root = copy_field(ICodeImport['cvs_root'], readonly=False) |
70 | 440 | ['url', 'cvs_root', 'cvs_module']) | 440 | cvs_module = copy_field(ICodeImport['cvs_module'], readonly=False) |
71 | 441 | whiteboard = copy_field(IBranch['whiteboard']) | 441 | whiteboard = copy_field(IBranch['whiteboard']) |
72 | 442 | 442 | ||
73 | 443 | 443 | ||
74 | 444 | 444 | ||
75 | === modified file 'lib/lp/code/browser/configure.zcml' | |||
76 | --- lib/lp/code/browser/configure.zcml 2010-03-12 18:28:28 +0000 | |||
77 | +++ lib/lp/code/browser/configure.zcml 2010-03-17 21:52:39 +0000 | |||
78 | @@ -714,6 +714,11 @@ | |||
79 | 714 | template="../templates/codeimport-new.pt" | 714 | template="../templates/codeimport-new.pt" |
80 | 715 | permission="launchpad.AnyPerson"/> | 715 | permission="launchpad.AnyPerson"/> |
81 | 716 | </facet> | 716 | </facet> |
82 | 717 | <browser:url | ||
83 | 718 | for="lp.code.interfaces.codeimport.ICodeImport" | ||
84 | 719 | attribute_to_parent="branch" | ||
85 | 720 | path_expression="string:+code-import" | ||
86 | 721 | rootsite="code"/> | ||
87 | 717 | <browser:navigation | 722 | <browser:navigation |
88 | 718 | module="lp.code.browser.codeimport" | 723 | module="lp.code.browser.codeimport" |
89 | 719 | classes=" | 724 | classes=" |
90 | 720 | 725 | ||
91 | === modified file 'lib/lp/code/doc/codeimport.txt' | |||
92 | --- lib/lp/code/doc/codeimport.txt 2010-03-09 12:01:49 +0000 | |||
93 | +++ lib/lp/code/doc/codeimport.txt 2010-03-17 21:52:39 +0000 | |||
94 | @@ -468,14 +468,14 @@ | |||
95 | 468 | >>> print canonical_url(code_import_set) | 468 | >>> print canonical_url(code_import_set) |
96 | 469 | http://code.launchpad.dev/+code-imports | 469 | http://code.launchpad.dev/+code-imports |
97 | 470 | 470 | ||
100 | 471 | The code imports themselves are viewed under the branch's URL, | 471 | The code imports themselves have a canonical URL that is subordinate of |
101 | 472 | and are not traversable in themselves. | 472 | the branches, though they cannot currently be viewed that way in the webapp, |
102 | 473 | only over the API. | ||
103 | 473 | 474 | ||
104 | 474 | >>> print canonical_url(svn_import.branch) | 475 | >>> print canonical_url(svn_import.branch) |
105 | 475 | http://code.launchpad.dev/~no-priv/firefox/trunk-svn | 476 | http://code.launchpad.dev/~no-priv/firefox/trunk-svn |
106 | 476 | >>> print canonical_url(svn_import) | 477 | >>> print canonical_url(svn_import) |
109 | 477 | Traceback (most recent call last): | 478 | http://code.launchpad.dev/~no-priv/firefox/trunk-svn/+code-import |
108 | 478 | NoCanonicalUrl: ... | ||
110 | 479 | 479 | ||
111 | 480 | 480 | ||
112 | 481 | Modifying CodeImports | 481 | Modifying CodeImports |
113 | 482 | 482 | ||
114 | === modified file 'lib/lp/code/interfaces/branch.py' | |||
115 | --- lib/lp/code/interfaces/branch.py 2010-03-10 18:58:02 +0000 | |||
116 | +++ lib/lp/code/interfaces/branch.py 2010-03-17 21:52:39 +0000 | |||
117 | @@ -855,8 +855,10 @@ | |||
118 | 855 | browse_source_url = Attribute( | 855 | browse_source_url = Attribute( |
119 | 856 | "The URL of the source browser for this branch.") | 856 | "The URL of the source browser for this branch.") |
120 | 857 | 857 | ||
123 | 858 | # Don't use Object -- that would cause an import loop with ICodeImport. | 858 | # Really ICodeImport, but that would cause a circular import |
124 | 859 | code_import = Attribute("The associated CodeImport, if any.") | 859 | code_import = exported( |
125 | 860 | Reference( | ||
126 | 861 | title=_("The associated CodeImport, if any."), schema=Interface)) | ||
127 | 860 | 862 | ||
128 | 861 | bzr_identity = exported( | 863 | bzr_identity = exported( |
129 | 862 | Text( | 864 | Text( |
130 | 863 | 865 | ||
131 | === modified file 'lib/lp/code/interfaces/codeimport.py' | |||
132 | --- lib/lp/code/interfaces/codeimport.py 2010-03-05 03:51:59 +0000 | |||
133 | +++ lib/lp/code/interfaces/codeimport.py 2010-03-17 21:52:39 +0000 | |||
134 | @@ -23,6 +23,9 @@ | |||
135 | 23 | from canonical.launchpad.validators import LaunchpadValidationError | 23 | from canonical.launchpad.validators import LaunchpadValidationError |
136 | 24 | from lp.code.enums import CodeImportReviewStatus, RevisionControlSystems | 24 | from lp.code.enums import CodeImportReviewStatus, RevisionControlSystems |
137 | 25 | 25 | ||
138 | 26 | from lazr.restful.declarations import ( | ||
139 | 27 | export_as_webservice_entry, exported) | ||
140 | 28 | |||
141 | 26 | 29 | ||
142 | 27 | def validate_cvs_root(cvsroot): | 30 | def validate_cvs_root(cvsroot): |
143 | 28 | try: | 31 | try: |
144 | @@ -60,13 +63,17 @@ | |||
145 | 60 | class ICodeImport(Interface): | 63 | class ICodeImport(Interface): |
146 | 61 | """A code import to a Bazaar Branch.""" | 64 | """A code import to a Bazaar Branch.""" |
147 | 62 | 65 | ||
148 | 66 | export_as_webservice_entry() | ||
149 | 67 | |||
150 | 63 | id = Int(readonly=True, required=True) | 68 | id = Int(readonly=True, required=True) |
151 | 64 | date_created = Datetime( | 69 | date_created = Datetime( |
152 | 65 | title=_("Date Created"), required=True, readonly=True) | 70 | title=_("Date Created"), required=True, readonly=True) |
153 | 66 | 71 | ||
157 | 67 | branch = Choice( | 72 | branch = exported( |
158 | 68 | title=_('Branch'), required=True, readonly=True, vocabulary='Branch', | 73 | Choice( |
159 | 69 | description=_("The Bazaar branch produced by the import system.")) | 74 | title=_('Branch'), required=True, readonly=True, |
160 | 75 | vocabulary='Branch', | ||
161 | 76 | description=_("The Bazaar branch produced by the import system."))) | ||
162 | 70 | 77 | ||
163 | 71 | registrant = PublicPersonChoice( | 78 | registrant = PublicPersonChoice( |
164 | 72 | title=_('Registrant'), required=True, readonly=True, | 79 | title=_('Registrant'), required=True, readonly=True, |
165 | @@ -94,39 +101,44 @@ | |||
166 | 94 | description=_("The series this import is registered as the " | 101 | description=_("The series this import is registered as the " |
167 | 95 | "code for, or None if there is no such series.")) | 102 | "code for, or None if there is no such series.")) |
168 | 96 | 103 | ||
202 | 97 | review_status = Choice( | 104 | review_status = exported( |
203 | 98 | title=_("Review Status"), vocabulary=CodeImportReviewStatus, | 105 | Choice( |
204 | 99 | default=CodeImportReviewStatus.NEW, | 106 | title=_("Review Status"), vocabulary=CodeImportReviewStatus, |
205 | 100 | description=_("Before a code import is performed, it is reviewed." | 107 | default=CodeImportReviewStatus.NEW, readonly=True, |
206 | 101 | " Only reviewed imports are processed.")) | 108 | description=_("Before a code import is performed, it is reviewed." |
207 | 102 | 109 | " Only reviewed imports are processed."))) | |
208 | 103 | rcs_type = Choice(title=_("Type of RCS"), | 110 | |
209 | 104 | required=True, vocabulary=RevisionControlSystems, | 111 | rcs_type = exported( |
210 | 105 | description=_( | 112 | Choice(title=_("Type of RCS"), readonly=True, |
211 | 106 | "The version control system to import from. " | 113 | required=True, vocabulary=RevisionControlSystems, |
212 | 107 | "Can be CVS or Subversion.")) | 114 | description=_( |
213 | 108 | 115 | "The version control system to import from. " | |
214 | 109 | url = URIField(title=_("URL"), required=False, | 116 | "Can be CVS or Subversion."))) |
215 | 110 | description=_("The URL of the VCS branch."), | 117 | |
216 | 111 | allowed_schemes=["http", "https", "svn", "git"], | 118 | url = exported( |
217 | 112 | allow_userinfo=False, # Only anonymous access is supported. | 119 | URIField(title=_("URL"), required=False, readonly=True, |
218 | 113 | allow_port=True, | 120 | description=_("The URL of the VCS branch."), |
219 | 114 | allow_query=False, # Query makes no sense in Subversion. | 121 | allowed_schemes=["http", "https", "svn", "git"], |
220 | 115 | allow_fragment=False, # Fragment makes no sense in Subversion. | 122 | allow_userinfo=False, # Only anonymous access is supported. |
221 | 116 | trailing_slash=False) # See http://launchpad.net/bugs/56357. | 123 | allow_port=True, |
222 | 117 | 124 | allow_query=False, # Query makes no sense in Subversion. | |
223 | 118 | cvs_root = TextLine(title=_("Repository"), required=False, | 125 | allow_fragment=False, # Fragment makes no sense in Subversion. |
224 | 119 | constraint=validate_cvs_root, | 126 | trailing_slash=False)) # See http://launchpad.net/bugs/56357. |
225 | 120 | description=_("The CVSROOT. " | 127 | |
226 | 121 | "Example: :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome")) | 128 | cvs_root = exported( |
227 | 122 | 129 | TextLine(title=_("Repository"), required=False, readonly=True, | |
228 | 123 | cvs_module = TextLine(title=_("Module"), required=False, | 130 | constraint=validate_cvs_root, |
229 | 124 | constraint=validate_cvs_module, | 131 | description=_("The CVSROOT. " |
230 | 125 | description=_("The path to import within the repository." | 132 | "Example: :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome"))) |
231 | 126 | " Usually, it is the name of the project.")) | 133 | |
232 | 127 | 134 | cvs_module = exported( | |
233 | 128 | date_last_successful = Datetime( | 135 | TextLine(title=_("Module"), required=False, readonly=True, |
234 | 129 | title=_("Last successful"), required=False) | 136 | constraint=validate_cvs_module, |
235 | 137 | description=_("The path to import within the repository." | ||
236 | 138 | " Usually, it is the name of the project."))) | ||
237 | 139 | |||
238 | 140 | date_last_successful = exported( | ||
239 | 141 | Datetime(title=_("Last successful"), required=False, readonly=True)) | ||
240 | 130 | 142 | ||
241 | 131 | update_interval = Timedelta( | 143 | update_interval = Timedelta( |
242 | 132 | title=_("Update interval"), required=False, description=_( | 144 | title=_("Update interval"), required=False, description=_( |
243 | 133 | 145 | ||
244 | === modified file 'lib/lp/code/interfaces/webservice.py' | |||
245 | --- lib/lp/code/interfaces/webservice.py 2009-07-17 00:26:05 +0000 | |||
246 | +++ lib/lp/code/interfaces/webservice.py 2010-03-17 21:52:39 +0000 | |||
247 | @@ -6,6 +6,7 @@ | |||
248 | 6 | from lp.code.interfaces.branch import IBranch, IBranchSet | 6 | from lp.code.interfaces.branch import IBranch, IBranchSet |
249 | 7 | from lp.code.interfaces.branchmergeproposal import IBranchMergeProposal | 7 | from lp.code.interfaces.branchmergeproposal import IBranchMergeProposal |
250 | 8 | from lp.code.interfaces.branchsubscription import IBranchSubscription | 8 | from lp.code.interfaces.branchsubscription import IBranchSubscription |
251 | 9 | from lp.code.interfaces.codeimport import ICodeImport | ||
252 | 9 | from lp.code.interfaces.codereviewcomment import ICodeReviewComment | 10 | from lp.code.interfaces.codereviewcomment import ICodeReviewComment |
253 | 10 | from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference | 11 | from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference |
254 | 11 | from lp.code.interfaces.diff import IDiff, IPreviewDiff, IStaticDiff | 12 | from lp.code.interfaces.diff import IDiff, IPreviewDiff, IStaticDiff |
255 | 12 | 13 | ||
256 | === modified file 'lib/lp/code/stories/webservice/xx-branch.txt' | |||
257 | --- lib/lp/code/stories/webservice/xx-branch.txt 2010-02-17 22:34:52 +0000 | |||
258 | +++ lib/lp/code/stories/webservice/xx-branch.txt 2010-03-17 21:52:39 +0000 | |||
259 | @@ -108,6 +108,7 @@ | |||
260 | 108 | branch_format: None | 108 | branch_format: None |
261 | 109 | branch_type: u'Hosted' | 109 | branch_type: u'Hosted' |
262 | 110 | bzr_identity: u'lp://dev/~eric/fooix/trunk' | 110 | bzr_identity: u'lp://dev/~eric/fooix/trunk' |
263 | 111 | code_import_link: None | ||
264 | 111 | control_format: None | 112 | control_format: None |
265 | 112 | date_created: u'2009-01-01T00:00:00+00:00' | 113 | date_created: u'2009-01-01T00:00:00+00:00' |
266 | 113 | date_last_modified: u'2009-01-01T00:00:00+00:00' | 114 | date_last_modified: u'2009-01-01T00:00:00+00:00' |
267 | 114 | 115 | ||
268 | === added file 'lib/lp/code/stories/webservice/xx-code-import.txt' | |||
269 | --- lib/lp/code/stories/webservice/xx-code-import.txt 1970-01-01 00:00:00 +0000 | |||
270 | +++ lib/lp/code/stories/webservice/xx-code-import.txt 2010-03-17 21:52:39 +0000 | |||
271 | @@ -0,0 +1,59 @@ | |||
272 | 1 | Introduction | ||
273 | 2 | ============ | ||
274 | 3 | |||
275 | 4 | Launchpad can tell you about the code imports that power a branch | ||
276 | 5 | if it is an import branch. | ||
277 | 6 | |||
278 | 7 | >>> from zope.security.proxy import removeSecurityProxy | ||
279 | 8 | |||
280 | 9 | First we create some objects for use in the tests. | ||
281 | 10 | |||
282 | 11 | >>> login(ANONYMOUS) | ||
283 | 12 | >>> person = factory.makePerson(name='import-owner') | ||
284 | 13 | >>> product = factory.makeProduct(name='scruff') | ||
285 | 14 | >>> code_import = removeSecurityProxy(factory.makeCodeImport( | ||
286 | 15 | ... registrant=person, product=product, branch_name='import')) | ||
287 | 16 | >>> no_import_branch = removeSecurityProxy(factory.makeProductBranch( | ||
288 | 17 | ... owner=person, product=product, name='no-import')) | ||
289 | 18 | >>> logout() | ||
290 | 19 | |||
291 | 20 | If we query a branch with no import then we find that it tells us | ||
292 | 21 | it doesn't have one. | ||
293 | 22 | |||
294 | 23 | >>> branch_url = '/' + no_import_branch.unique_name | ||
295 | 24 | >>> response = webservice.get(branch_url) | ||
296 | 25 | >>> representation = response.jsonBody() | ||
297 | 26 | >>> print representation['code_import_link'] | ||
298 | 27 | None | ||
299 | 28 | |||
300 | 29 | For a branch with an import we get a link to the import entry in its | ||
301 | 30 | representation. | ||
302 | 31 | |||
303 | 32 | >>> branch_url = '/' + code_import.branch.unique_name | ||
304 | 33 | >>> response = webservice.get(branch_url) | ||
305 | 34 | >>> representation = response.jsonBody() | ||
306 | 35 | >>> print representation['code_import_link'] | ||
307 | 36 | http://.../~import-owner/scruff/import/+code-import | ||
308 | 37 | |||
309 | 38 | We can get some information about the import using this URL. | ||
310 | 39 | |||
311 | 40 | >>> import_url = representation['code_import_link'] | ||
312 | 41 | >>> response = webservice.get(import_url) | ||
313 | 42 | >>> representation = response.jsonBody() | ||
314 | 43 | >>> print representation['self_link'] == import_url | ||
315 | 44 | True | ||
316 | 45 | >>> print representation['branch_link'] | ||
317 | 46 | http://.../~import-owner/scruff/import | ||
318 | 47 | >>> print representation['review_status'] | ||
319 | 48 | Pending Review | ||
320 | 49 | >>> print representation['rcs_type'] | ||
321 | 50 | Subversion via CSCVS | ||
322 | 51 | >>> print representation['url'] | ||
323 | 52 | http://domain9.domain.com/path10 | ||
324 | 53 | >>> print representation['cvs_root'] | ||
325 | 54 | None | ||
326 | 55 | >>> print representation['cvs_module'] | ||
327 | 56 | None | ||
328 | 57 | >>> print representation['date_last_successful'] | ||
329 | 58 | None | ||
330 | 59 |
I think this is a great start.