Package entropy :: Package services :: Package test :: Module commands

Source Code for Module entropy.services.test.commands

 1  # -*- coding: utf-8 -*- 
 2  """ 
 3   
 4      @author: Fabio Erculiani <lxnay@sabayonlinux.org> 
 5      @contact: lxnay@sabayonlinux.org 
 6      @copyright: Fabio Erculiani 
 7      @license: GPL-2 
 8   
 9      B{Entropy Services Testing Command Interface}. 
10   
11  """ 
12  from entropy.services.skel import SocketCommands 
13   
14 -class Test(SocketCommands):
15 16 import entropy.dump as dumpTools 17 import entropy.tools as entropyTools
18 - def __init__(self, HostInterface):
19 20 SocketCommands.__init__(self, HostInterface, inst_name = "test-commands") 21 self.raw_commands = ['test:echo'] 22 23 self.valid_commands = { 24 'test:echo': { 25 'auth': False, 26 'built_in': False, 27 'cb': self.docmd_echo, 28 'args': ["myargs"], 29 'as_user': False, 30 'desc': "print arguments echo", 31 'syntax': "<SESSION_ID> test:echo <raw_data>", 32 'from': unicode(self), 33 }, 34 }
35 36
37 - def docmd_echo(self, myargs):
38 39 if not myargs: 40 return None, 'wrong arguments' 41 42 return True, ' '.join(myargs)
43