Anonymous avatar Anonymous committed 9dc9afa

Implement new metadata

Comments (0)

Files changed (3)

templates/display.pt

   </ul>
  </li>
 
+
+ <li tal:condition="data/requires_dist | nothing">
+   <strong>Requires</strong>
+   <ul class="nodot">
+     <li tal:repeat="require data/requires_dist">
+       <a tal:attributes="href require/href"
+	  tal:content="require/name"/>
+     </li>
+   </ul>
+ </li>
+
+ <li tal:condition="data/provides_dist | nothing">
+   <strong>Provides</strong>
+   <ul class="nodot">
+     <li tal:repeat="provide data/provides_dist">
+       <a tal:attributes="href provide/href"
+	  tal:content="provide/name"/>
+     </li>
+   </ul>
+ </li>
+
  <li tal:condition="data/roles/Owner | nothing">
   <strong>Package Index Owner:</strong>
   <span tal:content="python:', '.join(data['roles']['Owner'])" />

templates/standard_template.pt

        <link rel="stylesheet" tal:attributes="href string:${app/config/pydotorg}css/pypi.css" type="text/css"/>
 
        <link rel="alternate" type="application/rss+xml" title="RSS: 30 latest updates" href="http://www.python.org/pypi?:action=rss"/>
-      <link media="screen" tal:attributes="href string:${app/config/pydotorg}styles/screen-switcher-default.css" type="text/css" id="screen-switcher-stylesheet" rel="stylesheet" />
-      <link media="screen" tal:attributes="href string:${app/config/pydotorg}styles/netscape4.css" type="text/css" rel="stylesheet" />
-      <link media="print" tal:attributes="href string:${app/config/pydotorg}styles/print.css" type="text/css" rel="stylesheet" />
-      <link media="screen" tal:attributes="href string:${app/config/pydotorg}styles/largestyles.css" type="text/css" rel="alternate stylesheet" title="large text" />
-      <link media="screen" tal:attributes="href string:${app/config/pydotorg}styles/defaultfonts.css" type="text/css" rel="alternate stylesheet" title="default fonts" />
-      <link rel="stylesheet" media="screen" href="/css/docutils.css" type="text/css"/>
+       <link media="screen" tal:attributes="href string:${app/config/pydotorg}styles/screen-switcher-default.css" type="text/css" id="screen-switcher-stylesheet" rel="stylesheet" />
+       <link media="screen" tal:attributes="href string:${app/config/pydotorg}styles/netscape4.css" type="text/css" rel="stylesheet" />
+       <link media="print" tal:attributes="href string:${app/config/pydotorg}styles/print.css" type="text/css" rel="stylesheet" />
+       <link media="screen" tal:attributes="href string:${app/config/pydotorg}styles/largestyles.css" type="text/css" rel="alternate stylesheet" title="large text" />
+       <link media="screen" tal:attributes="href string:${app/config/pydotorg}styles/defaultfonts.css" type="text/css" rel="alternate stylesheet" title="default fonts" />
+       <link rel="stylesheet" media="screen" href="/css/docutils.css" type="text/css"/>
       
-      <metal:slot define-slot="head" />
+       <metal:slot define-slot="head" />
     </head>
     <body>
       <!--  Logo  -->
             
             </div>
 
-	    <div id="document-navigation" style="float:right">
-	      <h4>Project-URL</h4>
-	      <ul>
-		<tal:block tal:repeat="project data/project_urls">
-		  <li><a tal:content="python:project[0]" tal:attributes="href python:project[1]"></a></li>
-		</tal:block>
-	      </ul>
-	    </div>
+	    <tal:block condition="data/project_url | nothing">
+	      <div id="document-navigation" style="float:right">
+		<h4>Project-URL</h4>
+		<ul>
+		  <tal:block tal:repeat="project data/project_url">
+		    <li>
+		      <a tal:content="python:project[0]" tal:attributes="href python:project[1]"></a>
+		    </li>
+		  </tal:block>
+		</ul>
+	      </div>
+	    </tal:block>
 
 	    </div>
 
             tally[r['rating']] += 1
 
         # New metadata
-        requires_dist = self.store.get_package_require_dist(name, version)
-        project_urls = []
-        for val in self.store.get_package_project_url(name, version):
-            try:
-                project_urls.append(val[0].split(','))
-            except:
-                continue
+        requires_dist = self.store.get_package_requires_dist(name, version)
+        provides_dist = self.store.get_package_provides_dist(name, version)
+        project_url = self.store.get_package_project_url(name, version)
 
         for c in comments:
             add = c, []
                             latestversion=latest_version,
                             latestversionurl=latest_version_url,
                             action=self.link_action(),
-                            requires_dists=requires_dist,
-                            project_urls=project_urls)
+                            requires_dist=requires_dist,
+                            provides_dist=provides_dist,
+                            project_url=project_url)
 
     def index(self, nav_current='index', releases=None):
         ''' Print up an index page
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.