25 SAFile = "eric6" |
25 SAFile = "eric6" |
26 |
26 |
27 # define the protocol tokens |
27 # define the protocol tokens |
28 SAOpenFile = '>OpenFile<' |
28 SAOpenFile = '>OpenFile<' |
29 SAOpenProject = '>OpenProject<' |
29 SAOpenProject = '>OpenProject<' |
|
30 SAOpenMultiProject = '>OpenMultiProject<' |
30 SAArguments = '>Arguments<' |
31 SAArguments = '>Arguments<' |
31 |
32 |
32 |
33 |
33 class E5SingleApplicationServer(SingleApplicationServer): |
34 class E5SingleApplicationServer(SingleApplicationServer): |
34 """ |
35 """ |
53 |
54 |
54 if cmd == SAOpenProject: |
55 if cmd == SAOpenProject: |
55 self.__saOpenProject(params) |
56 self.__saOpenProject(params) |
56 return |
57 return |
57 |
58 |
|
59 if cmd == SAOpenMultiProject: |
|
60 self.__saOpenMultiProject(params) |
|
61 return |
|
62 |
58 if cmd == SAArguments: |
63 if cmd == SAArguments: |
59 self.__saArguments(params) |
64 self.__saArguments(params) |
60 return |
65 return |
61 |
66 |
62 def __saOpenFile(self, fname): |
67 def __saOpenFile(self, fname): |
72 Private method used to handle the "Open Project" command. |
77 Private method used to handle the "Open Project" command. |
73 |
78 |
74 @param pfname filename of the project to be opened (string) |
79 @param pfname filename of the project to be opened (string) |
75 """ |
80 """ |
76 e5App().getObject("Project").openProject(pfname) |
81 e5App().getObject("Project").openProject(pfname) |
|
82 |
|
83 def __saOpenMultiProject(self, pfname): |
|
84 """ |
|
85 Private method used to handle the "Open Multi-Project" command. |
|
86 |
|
87 @param pfname filename of the multi project to be opened (string) |
|
88 """ |
|
89 e5App().getObject("MultiProject").openMultiProject(pfname) |
77 |
90 |
78 def __saArguments(self, argsStr): |
91 def __saArguments(self, argsStr): |
79 """ |
92 """ |
80 Private method used to handle the "Arguments" command. |
93 Private method used to handle the "Arguments" command. |
81 |
94 |
129 ext = os.path.splitext(arg)[1] |
142 ext = os.path.splitext(arg)[1] |
130 ext = os.path.normcase(ext) |
143 ext = os.path.normcase(ext) |
131 |
144 |
132 if ext in ['.e4p']: |
145 if ext in ['.e4p']: |
133 self.__openProject(arg) |
146 self.__openProject(arg) |
|
147 elif ext in ['.e4m', '.e5m']: |
|
148 self.__openMultiProject(arg) |
134 else: |
149 else: |
135 self.__openFile(arg) |
150 self.__openFile(arg) |
136 |
151 |
137 # send any args we had |
152 # send any args we had |
138 if argsStr is not None: |
153 if argsStr is not None: |
156 @param pfname name of the projectfile to be opened (string) |
171 @param pfname name of the projectfile to be opened (string) |
157 """ |
172 """ |
158 cmd = "{0}{1}\n".format(SAOpenProject, Utilities.normabspath(pfname)) |
173 cmd = "{0}{1}\n".format(SAOpenProject, Utilities.normabspath(pfname)) |
159 self.sendCommand(cmd) |
174 self.sendCommand(cmd) |
160 |
175 |
|
176 def __openMultiProject(self, pfname): |
|
177 """ |
|
178 Private method to open a project in the application server. |
|
179 |
|
180 @param pfname name of the projectfile to be opened (string) |
|
181 """ |
|
182 cmd = "{0}{1}\n".format(SAOpenMultiProject, |
|
183 Utilities.normabspath(pfname)) |
|
184 self.sendCommand(cmd) |
|
185 |
161 def __sendArguments(self, argsStr): |
186 def __sendArguments(self, argsStr): |
162 """ |
187 """ |
163 Private method to set the command arguments in the application server. |
188 Private method to set the command arguments in the application server. |
164 |
189 |
165 @param argsStr space delimited list of command args (string) |
190 @param argsStr space delimited list of command args (string) |