From a1abac5261378bf0562295ca4e0222fbaed8f676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Wed, 7 Sep 2005 14:02:25 +0000 Subject: [PATCH] =?UTF-8?q?Python=20Mod=C3=BClleri=20API'si...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/actionsapi/pythonmodules.py | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 pisi/actionsapi/pythonmodules.py diff --git a/pisi/actionsapi/pythonmodules.py b/pisi/actionsapi/pythonmodules.py new file mode 100644 index 00000000..47583f83 --- /dev/null +++ b/pisi/actionsapi/pythonmodules.py @@ -0,0 +1,48 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Copyright (C) 2005, TUBITAK/UEKAE +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# Please read the COPYING file. + +# standard python modules +import os + +# Pisi Modules +import pisi.context as ctx + +# ActionsAPI Modules +import pisi.actionsapi +import pisi.actionsapi.get as get +from pisi.actionsapi.shelltools import system, can_access_file +from pisi.actionsapi.pisitools import dodoc + +class CompileError(pisi.actionsapi.Error): + def __init__(self, Exception): + ctx.ui.error(Exception) + +class InstallError(pisi.actionsapi.Error): + def __init__(self, Exception): + ctx.ui.error(Exception) + +def compile(parameters = ''): + '''compile source with given parameters.''' + if system('python setup.py build %s' % (get.installDIR(), parameters)): + raise CompileError('!!! Make failed...\n') + +def install(parameters = ''): + '''does python setup.py install''' + if system('python setup.py install --root=%s --no-compile %s' % (get.installDIR(), parameters)): + raise InstallError('!!! Install failed...\n') + + DDOCS = 'CHANGELOG COPYRIGHT KNOWN_BUGS MAINTAINERS PKG-INFO \ + CONTRIBUTORS LICENSE COPYING* Change* MANIFEST* README*' + + for doc in DDOCS: + if can_access_file(doc): + pisitools.dodoc(doc)