Dashboard > Pulse v2.1 > ... > Remote API Examples > Python Example - Get Project Name By ID
  Pulse v2.1 Log In | Sign Up   View a printable version of the current page.  
  Python Example - Get Project Name By ID
Added by Jason Sankey, last edited by Jason Sankey on Mar 19, 2009
Labels: 
(None)

Pulse Manual Index

Overview

This example is a handy way to map from a database identifier to a project name, which can be useful when you are trying to associated a project with a directory (some of which are named by ID) or error message.

Code

#! /usr/bin/env python

from xmlrpclib import ServerProxy, Error

PROJECT_ID = "98305"

server = ServerProxy("http://pulse/xmlrpc")

try:
    token = server.RemoteApi.login("user", "secret")
    print server.RemoteApi.getProjectNameById(token, PROJECT_ID)
    server.RemoteApi.logout(token)
except Error, v:
    print "Error:", v

Zutubi wiki is Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.10 Build:#528 Nov 29, 2006) - Bug/feature request - Contact Administrators