[125603] users/g5pw/pypi2port/pypi2port.py
g5pw at macports.org
g5pw at macports.org
Mon Sep 22 12:10:35 PDT 2014
Revision: 125603
https://trac.macports.org/changeset/125603
Author: g5pw at macports.org
Date: 2014-09-22 12:10:35 -0700 (Mon, 22 Sep 2014)
Log Message:
-----------
Add second newline before functions
Modified Paths:
--------------
users/g5pw/pypi2port/pypi2port.py
Modified: users/g5pw/pypi2port/pypi2port.py
===================================================================
--- users/g5pw/pypi2port/pypi2port.py 2014-09-22 19:03:13 UTC (rev 125602)
+++ users/g5pw/pypi2port/pypi2port.py 2014-09-22 19:10:35 UTC (rev 125603)
@@ -29,12 +29,14 @@
client = xmlrpclib.ServerProxy('http://pypi.python.org/pypi')
+
def list_all():
""" Lists all packages available in pypi database """
list_packages = client.list_packages()
for package in list_packages:
print package
+
def search(pkg_name):
""" Searches for a particular package by the name classifier """
values = client.search({'name': pkg_name})
@@ -42,6 +44,7 @@
for key in value.keys():
print key, '-->', value[key]
+
def release_data(pkg_name, pkg_version):
""" Fetches the release data for a paticular package based on
the package_name and package_version """
@@ -56,6 +59,7 @@
return
return
+
def fetch(pkg_name, dict):
""" Fetches the distfile for a particular package name and release_url """
print "Fetching distfiles..."
@@ -115,6 +119,7 @@
print "Error: %s - %s." % (e.filename, e.strerror)
return False
+
def fetch_url(pkg_name, pkg_version, checksum=False, deps=False):
""" Checks for the checksums and dependecies for a particular python package
on the basis of package_name and package_version """
@@ -128,6 +133,7 @@
for value in values:
return fetch(pkg_name, value)
+
def dependencies(pkg_name, pkg_version, deps=False):
""" Finds dependencies for a particular package on the basis of
package_name and package_version """
@@ -175,6 +181,7 @@
pass
return False
+
def create_diff(old_file, new_file, diff_file):
""" Creates a diff file for an existent port """
with open(old_file) as f:
@@ -191,6 +198,7 @@
except:
pass
+
def search_port(name):
""" Searches for an existent port by its name """
try:
@@ -202,6 +210,7 @@
except Exception:
return False
+
def checksums(pkg_name, pkg_version):
""" Generates checksums for a package on the basis of the distfile fetched by
its package_name and package_version """
@@ -237,6 +246,7 @@
print "Error\n"
return
+
def search_distfile(name, version):
""" Searches if the distfile listed is present or not """
try:
@@ -249,6 +259,7 @@
print "Please set a DISTFILE env var before generating the portfile"
sys.exit(0)
+
def search_license(license):
""" Maps the license passed to the already present list of
licences available in Macports """
@@ -269,6 +280,7 @@
if match:
return licenses[i]
+
def port_testing(name, portv='27'):
""" Port Testing function for various phase implementations """
euid = os.geteuid()
@@ -293,6 +305,7 @@
args = ['sudo', sys.executable] + sys.argv + [os.environ]
os.execlpe('sudo', *args)
+
def port_fetch(name, portv='27'):
""" Fetch phase implementation """
try:
@@ -304,6 +317,7 @@
except:
return False
+
def port_checksum(name, portv='27'):
""" Checksum phase implementation """
try:
@@ -315,6 +329,7 @@
except:
return False
+
def port_extract(name, portv='27'):
""" Checksum phase implementation """
try:
@@ -326,6 +341,7 @@
except:
return False
+
def port_patch(name, portv='27'):
""" Patch phase implementation """
try:
@@ -337,6 +353,7 @@
except:
return False
+
def port_configure(name, portv='27'):
""" Configure phase implementation """
try:
@@ -348,6 +365,7 @@
except:
return False
+
def port_build(name, portv='27'):
""" Build phase implementation """
try:
@@ -359,6 +377,7 @@
except:
return False
+
def port_destroot(name, portv='27'):
""" Destroot phase implementation """
try:
@@ -370,6 +389,7 @@
except:
return False
+
def port_clean(name, portv='27'):
""" Clean phase implementation """
try:
@@ -381,6 +401,7 @@
except:
return False
+
def create_portfile(dict, file_name, dict2):
""" Creates a portfile on the basis of the release_data and release_url fetched
on the basis of package_name and package_version """
@@ -591,6 +612,7 @@
else:
print "No port found."
+
def print_portfile(pkg_name, pkg_version=None):
""" Creates the directories and other commands necessary
for a development environment """
@@ -627,6 +649,7 @@
create_portfile(dict, file_name, dict2)
print "SUCCESS\n"
+
def main(argv):
""" Main function - Argument Parser """
parser = argparse.ArgumentParser(description="Pypi2Port Tester")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140922/aa0b68af/attachment.html>
More information about the macports-changes
mailing list