From 100f54d56ca930606d1a57c9353f315364c5e59a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Fri, 4 Nov 2005 12:51:48 +0000 Subject: [PATCH] * start coding component stuff --- TODO | 2 +- pisi.e3p | 19 +++++++++---------- pisi/{data.py => component.py} | 20 +++++++++++++++++--- 3 files changed, 27 insertions(+), 14 deletions(-) rename pisi/{data.py => component.py} (84%) diff --git a/TODO b/TODO index c0c52afa..7359a174 100644 --- a/TODO +++ b/TODO @@ -91,7 +91,7 @@ Legend: / revise writing, error checking, printing and tests / components and distribution (eray) + requirements - / xml format + + xml format - query components: list of components/packages in a component - install/remove components - safety switch: preserve system:base, install system:devel for build, etc. diff --git a/pisi.e3p b/pisi.e3p index 41779f95..e1fa7c55 100644 --- a/pisi.e3p +++ b/pisi.e3p @@ -1,7 +1,7 @@ - + Python @@ -317,10 +317,6 @@ cli colors.py - - pisi - data.py - pisi-cli @@ -375,11 +371,14 @@ tests - specfileoldtests.py + filestests.py - tests - filestests.py + component.py + + + pisi + component.py @@ -422,10 +421,10 @@ {'standardLayout': 1} - + - + diff --git a/pisi/data.py b/pisi/component.py similarity index 84% rename from pisi/data.py rename to pisi/component.py index adf66898..86191043 100644 --- a/pisi/data.py +++ b/pisi/component.py @@ -17,10 +17,15 @@ import gettext __trans = gettext.translation('pisi', fallback=True) _ = __trans.ugettext +import pisi import pisi.xmlfile +class Error(pisi.Error): + pass + __metaclass__ = xmlfile.autoxml + class Distribution: t_Name = [xmlfile.Text, xmlfile.mandatory] t_Description = [xmlfile.LocalText, xmlfile.mandatory] @@ -28,18 +33,27 @@ class Distribution: t_Type = [xmlfile.Text, xmlfile.mandatory] t_Dependencies = [ [xmlfile.Text], xmlfile.optional, "Distribution"] -class Component: + +class Component(xmlfile.XmlFile): "part-of representation for component declarations" + + __metaclass__ = xmlfile.autoxml + + tag = "PISI" t_Name = [xmlfile.Text, xmlfile.mandatory] # fully qualified name t_PartOf = [xmlfile.Text, xmlfile.mandatory] t_LocalName = [xmlfile.LocalText, xmlfile.mandatory] t_Description = [xmlfile.LocalText, xmlfile.mandatory] #t_Icon = [xmlfile.Binary, xmlfile.mandatory] - t_Dependencies = [ [xmlfile.String], xmlfile.optional, "Component"] + t_Dependencies = [ [xmlfile.String], xmlfile.optional, "Dependencies/Component"] -class ComponentTree: + +class ComponentTree(xmlfile.XmlFile): "index representation for the component structure" + + __metaclass__ = xmlfile.autoxml + tag = "Component" t_Name = [xmlfile.Text, xmlfile.mandatory] # fully qualified name