755
755
>>> print dependency.title.escapedtext
756
<a href="http://launchpad.dev/~mark/+archive/ppa">PPA for Mark Shuttleworth</a>
756
<a href="http://launchpad.dev/~mark/+archive/ppa">PPA for Mark
758
759
The form focus, now that we have a recorded dependencies, is set to the
759
760
first listed dependency.
1387
1388
>>> ppa_archive_view = create_initialized_view(
1388
1389
... cprov.archive, name="+admin")
1390
The validate_external_dependencies() method is called when validating and will
1391
return a list of errors if the data dis not validate. A valid entry is of the
1391
>>> from lp.soyuz.interfaces.archive import validate_external_dependencies
1393
The validate_external_dependencies() function is called when validating and
1394
will return a list of errors if the data dis not validate. A valid entry is
1393
1396
deb scheme://domain/ suite component[s]
1395
>>> print ppa_archive_view.validate_external_dependencies(
1398
>>> print validate_external_dependencies(
1396
1399
... "deb http://example.com/ karmic main")
1399
1402
Multiple entries are valid, separated by newlines:
1401
>>> print ppa_archive_view.validate_external_dependencies(
1404
>>> print validate_external_dependencies(
1402
1405
... "deb http://example.com/ karmic main\n"
1403
1406
... "deb http://example.com/ karmic restricted")
1406
1409
If the line does not start with the word "deb" it fails:
1408
>>> print ppa_archive_view.validate_external_dependencies(
1411
>>> print validate_external_dependencies(
1409
1412
... "deb http://example.com/ karmic universe\n"
1410
1413
... "dab http://example.com/ karmic main")
1411
1414
["dab http://example.com/ karmic main: Must start with 'deb'"]
1413
1416
If the line has too few parts it fails. Here we're missing a suite:
1415
>>> print ppa_archive_view.validate_external_dependencies(
1418
>>> print validate_external_dependencies(
1416
1419
... "deb http://example.com/ karmic universe\n"
1417
1420
... "deb http://example.com/ main")
1418
1421
["'deb http://example.com/ main'
1421
1424
If the URL looks invalid, it fails:
1423
>>> print ppa_archive_view.validate_external_dependencies(
1426
>>> print validate_external_dependencies(
1424
1427
... "deb http://example.com/ karmic universe\n"
1425
1428
... "deb example.com/ karmic main")
1426
1429
['deb example.com/ karmic main: Invalid URL']