Package entropy :: Package services :: Package test :: Module interfaces

Source Code for Module entropy.services.test.interfaces

 1  # -*- coding: utf-8 -*- 
 2  ''' 
 3      # DESCRIPTION: 
 4      # Entropy Object Oriented Interface 
 5   
 6      Copyright (C) 2007-2009 Fabio Erculiani 
 7   
 8      This program is free software; you can redistribute it and/or modify 
 9      it under the terms of the GNU General Public License as published by 
10      the Free Software Foundation; either version 2 of the License, or 
11      (at your option) any later version. 
12   
13      This program is distributed in the hope that it will be useful, 
14      but WITHOUT ANY WARRANTY; without even the implied warranty of 
15      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
16      GNU General Public License for more details. 
17   
18      You should have received a copy of the GNU General Public License 
19      along with this program; if not, write to the Free Software 
20      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
21  ''' 
22  from entropy.services.interfaces import SocketHost 
23  from entropy.const import etpConst 
24  from entropy.output import TextInterface 
25   
26 -class Server(SocketHost):
27
29 - def __init__(self, *args, **kwargs):
30 self.Text = TextInterface() 31 self.Text.updateProgress(":: FakeServiceInterface loaded ::")
32
33 - def __init__(self, do_ssl = False, stdout_logging = True, 34 entropy_interface_kwargs = {}, **kwargs):
35 36 from entropy.services.system.commands import Base 37 if not kwargs.has_key('external_cmd_classes'): 38 kwargs['external_cmd_classes'] = [] 39 kwargs['external_cmd_classes'].insert(0, Base) 40 41 self.Text = TextInterface() 42 SocketHost.__init__( 43 self, 44 self.FakeServiceInterface, 45 sock_output = self.Text, 46 ssl = do_ssl, 47 **kwargs 48 ) 49 self.stdout_logging = stdout_logging
50