From 0f5c6dbb0fed651e4525c4e41f57697e7319d081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Thu, 7 Jul 2005 19:51:37 +0000 Subject: [PATCH] =?UTF-8?q?pisi-cli=202=20ayr=C4=B1=20yerde=20ayn=C4=B1=20?= =?UTF-8?q?dosya=20olarak=20duruyordu.=20Kozmetik=20de=C4=9Fi=C5=9Fiklik?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/configfile.py | 2 +- pisi/pisi-cli | 110 --------------------------------------------- 2 files changed, 1 insertion(+), 111 deletions(-) delete mode 100755 pisi/pisi-cli diff --git a/pisi/configfile.py b/pisi/configfile.py index 161089c3..5ac20758 100644 --- a/pisi/configfile.py +++ b/pisi/configfile.py @@ -22,7 +22,7 @@ class ConfigException(Exception): class GeneralDefaults: """Default values for [general] section""" - destinationdirectory = os.getcwd()+"/tmp" # FOR ALPHA + destinationdirectory = os.getcwd() + "/tmp" # FOR ALPHA class BuildDefaults: """Default values for [build] section""" diff --git a/pisi/pisi-cli b/pisi/pisi-cli deleted file mode 100755 index df686ad5..00000000 --- a/pisi/pisi-cli +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import sys -from optparse import OptionParser - -import pisi -from pisi.cli import buildhelper, installhelper, indexhelper - -usage = """%prog COMMAND [ARGUMENTS] [options] - -Where commands are bla bla... -""" - -class PisiCLI(object): - def __init__(self): - parser = OptionParser(usage=usage,version="%prog " + pisi.__version__) - - parser.add_option("-D", "--destdir", action="store") - parser.add_option("-u", "--username", action="store") - parser.add_option("-p", "--password", action="store") - parser.add_option("-P", action="store_true", dest="getpass", default=False, - help="Get password from the command line") - parser.add_option("-v", "--verbose", action="store_true", - dest="verbose", default=False, - help="detailed output") - parser.add_option("-d", "--debug", action="store_true", default=True) - parser.add_option("-n", "--dry-run", action="store_true", default=False, - help = "do not perform any action, just show what\ - would be done") - (options, args) = parser.parse_args() - self.parser = parser - - try: - self.cmd = args[0] - self.args = args[1:] - self.options = options - except IndexError: - print usage - sys.exit(1) - - self.authInfo = None - self.checkAuthInfo() - - def checkAuthInfo(self): - username = self.options.username - password = self.options.password - if not username and not password: - return # No authentication - elif username and password: - self.authInfo = (username, password) - return - - # TODO: yapılandırma dosyasını da kontrol et. Belki orada - # tanımlanmıştır? - - - if username and self.options.getpass: - from getpass import getpass - password = getpass("Password: ") - self.authInfo = (username, password) - return - - - # FIX: her komut için ayrı help - def help(self, command=""): - if not self.args: - print usage - return - - self.parser.print_help() - - def install(self): - if not self.args: - self.help("install") - for arg in self.args: - installhelper.install(arg) - - def build(self): - if not self.args: - self.help("build") - - for arg in self.args: - buildhelper.build(arg, self.authInfo) - - def updateindex(self): - """Update the repos db with the given index file (pisi-index.xml)""" - if len(self.args) != 1: - self.help("updateindex") - - indexfile = self.args[0] - indexhelper.updateindex(indexfile) - - - def runCommand(self): - commands = { - "help": self.help, - "install": self.install, - "build": self.build, - "updateindex": self.updateindex - } - - for key in commands.keys(): - if key == self.cmd: - commands[key]() - break - -if __name__ == "__main__": - cli = PisiCLI() - cli.runCommand()