* unuttugum ui modulunu koy
This commit is contained in:
@@ -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
@@ -1,3 +1,3 @@
|
|||||||
# utilities to extract and build archives of zip, tar, targz, tarbz2
|
# utilities to extract and build archives of zip, tar, targz, tarbz2
|
||||||
# maintainer: baris and murat
|
# maintainer: baris and meren
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -13,10 +13,10 @@ import dependency
|
|||||||
|
|
||||||
def install_package_file(package_fn):
|
def install_package_file(package_fn):
|
||||||
|
|
||||||
package = Package(package_fn, "r")
|
package = Package(package_fn, 'r')
|
||||||
# extract control files
|
# extract control files
|
||||||
util.clean_directory(install_dir)
|
util.clean_directory(install_dir)
|
||||||
ui.info.("extracting files\n")
|
ui.info.('extracting files\n')
|
||||||
package.extract_files(install_dir)
|
package.extract_files(install_dir)
|
||||||
|
|
||||||
# verify package
|
# verify package
|
||||||
@@ -33,7 +33,7 @@ def install_package_file(package_fn):
|
|||||||
# unzip package in place
|
# unzip package in place
|
||||||
|
|
||||||
# update databases
|
# update databases
|
||||||
installdb.install(spec.install_dir + '/files.xml')
|
|
||||||
|
|
||||||
# installdb
|
# installdb
|
||||||
|
installdb.install(spec.spec.install_dir + '/files.xml')
|
||||||
|
|
||||||
|
|||||||
@@ -68,3 +68,13 @@ class SpecFile(XmlFile):
|
|||||||
def write(self, filename):
|
def write(self, filename):
|
||||||
"""Write PSPEC file"""
|
"""Write PSPEC file"""
|
||||||
self.writexml(filename)
|
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")
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|
||||||
Reference in New Issue
Block a user