4 ## Copyright (c) 2010-2017 Intel Corporation
6 ## Licensed under the Apache License, Version 2.0 (the "License");
7 ## you may not use this file except in compliance with the License.
8 ## You may obtain a copy of the License at
10 ## http://www.apache.org/licenses/LICENSE-2.0
12 ## Unless required by applicable law or agreed to in writing, software
13 ## distributed under the License is distributed on an "AS IS" BASIS,
14 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 ## See the License for the specific language governing permissions and
16 ## limitations under the License.
24 def __init__(self, user, ip, proxDir, configDir):
27 self._proxDir = proxDir;
28 self._cfgFile = configDir;
29 def __init__(self, text):
30 self._user = text.split("@")[0];
31 text = text.split("@")[1];
32 self._ip = text.split(":")[0];
33 self._proxDir = text.split(":")[1];
34 self._cfgFile = text.split(":")[2];
49 def checkSyntax(text):
50 split = text.split("@");
52 return SystemConfig.getSyntaxError(text);
53 after = split[1].split(":");
55 return SystemConfig.getSyntaxError(text);
59 ret += " " + self._user + "@" + self._ip + "\n"
60 ret += " " + "prox dir: " + self._proxDir + "\n"
61 ret += " " + "cfg dir: " + self._cfgFile + "\n"
65 def getSyntaxError(text):
66 ret = "Invaild system syntax"
67 ret += ", got: " + str(text)
68 ret += ", expected: " + str(SystemConfig.expectedSyntax())
73 return "user@ip:proxDir:cfgFile"