def convert_requirement(req):
pkg_name = convert_name(req.project_name)<EOL>if not req.specs:<EOL><INDENT>return [pkg_name]<EOL><DEDENT>req_strs = []<EOL>for spec in req.specs:<EOL><INDENT>op, ver = spec<EOL>ver = convert_version(ver)<EOL>if op == "<STR_LIT:<>":<EOL><INDENT>r = "<STR_LIT>" % (pkg_name, ver)<EOL>req_strs.append(r)<EOL><DEDENT>elif op == "<STR_LIT>":<EOL><INDENT>r = "<STR_LIT>" % (pkg_name, ver, ver)<EOL>req_strs.append(r)<EOL><DEDENT>elif op == "<STR_LIT>":<EOL><INDENT>r = "<STR_LIT>" % (pkg_name, ver)<EOL>req_strs.append(r)<EOL><DEDENT>elif op == "<STR_LIT>":<EOL><INDENT>r = "<STR_LIT>" % (pkg_name, ver)<EOL>req_strs.append(r)<EOL><DEDENT>elif op == "<STR_LIT:>>":<EOL><INDENT>r1 = "<STR_LIT>" % (pkg_name, ver)<EOL>r2 = "<STR_LIT>" % (pkg_name, ver)<EOL>req_strs.append(r1)<EOL>req_strs.append(r2)<EOL><DEDENT>elif op == "<STR_LIT>":<EOL><INDENT>r = "<STR_LIT>" % (pkg_name, ver)<EOL>req_strs.append(r)<EOL><DEDENT>else:<EOL><INDENT>print >> sys.stderr,"<STR_LIT>" % op<EOL>req_strs.append(pkg_name)<EOL><DEDENT><DEDENT>return req_strs<EOL>
Converts a pkg_resources.Requirement object into a list of Rez package
request strings.