[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdesupport/emerge/bin
From: Wolfgang Rohdewald <wolfgang () rohdewald ! de>
Date: 2011-04-08 7:46:39
Message-ID: 20110408074639.EEF7EAC8D1 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1227373 by wrohdewald:
implement --print-installable in action.py
M +13 -5 action.py
--- trunk/kdesupport/emerge/bin/action.py #1227372:1227373
@@ -7,9 +7,11 @@
#
# @TODO review help texts
#
-#
+
import sys, argparse
+import portage
+
def m18n(s):
"""prelimary function for internationalization support"""
return s
@@ -118,6 +120,11 @@
"""mixin for obsolete arguments. Use this as first parent class"""
argGroupName = "Obsolete"
+class Print_installableArg(GeneralCommandArgBase):
+ """list packages that can be installed"""
+ def execArg(self):
+ portage.printInstallables()
+
class CleanallbuildsArg( GeneralCommandArgBase ):
"""clean complete build directory"""
@@ -234,8 +241,9 @@
ArgBase.classes[name].argValue = value
if not value == False:
print name, args.__dict__[name]
- if len([x for x in ArgBase.classes.values()
- if isinstance(x, PackageCommandArgBase) and x.argValue]) > 1:
- print 'only one command with TARGET may be given'
+ commands = list(x for x in ArgBase.classes.values()
+ if isinstance(x, CommandArgBase) and x.argValue)
+ if len(commands) != 1:
+ print 'exactly one command must be given for a TARGET'
sys.exit(2)
- # run action
+ commands[0].execArg()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic