Package caldavclientlibrary :: Package browser :: Module subshell
[hide private]
[frames] | no frames]

Source Code for Module caldavclientlibrary.browser.subshell

 1  ## 
 2  # Copyright (c) 2007-2016 Apple Inc. All rights reserved. 
 3  # 
 4  # Licensed under the Apache License, Version 2.0 (the "License"); 
 5  # you may not use this file except in compliance with the License. 
 6  # You may obtain a copy of the License at 
 7  # 
 8  # http://www.apache.org/licenses/LICENSE-2.0 
 9  # 
10  # Unless required by applicable law or agreed to in writing, software 
11  # distributed under the License is distributed on an "AS IS" BASIS, 
12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13  # See the License for the specific language governing permissions and 
14  # limitations under the License. 
15  ## 
16   
17  from caldavclientlibrary.browser.command import Command 
18  from caldavclientlibrary.browser.baseshell import BaseShell 
19   
20 -class SubShell(BaseShell):
21
22 - def __init__(self, shell, prefix, cmds):
23 24 super(SubShell, self).__init__("caldav_client.%s" % (prefix,)) 25 self.shell = shell 26 self.prefix = prefix 27 self.preserve_history = True 28 self.registerCommands(cmds)
29
30 - def registerCommands(self, cmds):
31 for cmd in cmds: 32 if isinstance(cmd, Command): 33 self.registerCommand(cmd)
34