* unuttugum ui modulunu koy

This commit is contained in:
Eray Özkural
2005-06-13 11:41:19 +00:00
parent a013538511
commit 749add6985
5 changed files with 37 additions and 10 deletions
-6
View File
@@ -1,6 +0,0 @@
Pazartesi 13 Haziran 2005 14:05 tarihinde, svn-internal@uludag.org.tr şunları
yazmıştı:
> * start a generalized ui module which will abstract the
> particulars of CLI, KDE, etc. (Beginning with CLI)
Eray, ui modülünü commit etmeyi unutmuşsun sanırım.
+1 -1
View File
@@ -1,3 +1,3 @@
# utilities to extract and build archives of zip, tar, targz, tarbz2
# maintainer: baris and murat
# maintainer: baris and meren
+3 -3
View File
@@ -13,10 +13,10 @@ import dependency
def install_package_file(package_fn):
package = Package(package_fn, "r")
package = Package(package_fn, 'r')
# extract control files
util.clean_directory(install_dir)
ui.info.("extracting files\n")
ui.info.('extracting files\n')
package.extract_files(install_dir)
# verify package
@@ -33,7 +33,7 @@ def install_package_file(package_fn):
# unzip package in place
# update databases
installdb.install(spec.install_dir + '/files.xml')
# installdb
installdb.install(spec.spec.install_dir + '/files.xml')
+10
View File
@@ -68,3 +68,13 @@ class SpecFile(XmlFile):
def write(self, filename):
"""Write PSPEC file"""
self.writexml(filename)
class MetaData(SpecFile):
"""This is a superset of the source spec definition"""
def read(self, filename):
SpecFile.read(filename)
distribution = self.getNodeText("Source/Distribution")
distributionRelease = self.getNodeText("Source/DistributionRelease")
architecture = self.getNodeText("Source/Architecture")
installsize = self.getNodeText("Source/InstallSize")
+23
View File
@@ -0,0 +1,23 @@
# generic user interface
import sys
# put the interface directly in the module
# since the UI is _unique_
def register(_impl):
""" Register a UI implementation"""
impl = _impl
def info(msg):
impl.info(msg)
# default UI implementation
class CLI:
def info(self, msg):
sys.stdout.write(msg)
sys.stdout.flush()
# default UI is CLI
impl = CLI()