15 |
15 |
16 from Toolbox.SingleApplication import SingleApplicationClient, \ |
16 from Toolbox.SingleApplication import SingleApplicationClient, \ |
17 SingleApplicationServer |
17 SingleApplicationServer |
18 |
18 |
19 ########################################################################### |
19 ########################################################################### |
20 # define some module global stuff |
20 ## define some module global stuff |
21 ########################################################################### |
21 ########################################################################### |
22 |
22 |
23 SAFile = "eric6_trpreviewer" |
23 SAFile = "eric6_trpreviewer" |
24 |
24 |
25 # define the protocol tokens |
25 # define the protocol tokens |
26 SALoadForm = '>LoadForm<' |
26 SALoadForm = 'LoadForm' |
27 SALoadTranslation = '>LoadTranslation<' |
27 SALoadTranslation = 'LoadTranslation' |
28 |
28 |
29 |
29 |
30 class TRSingleApplicationServer(SingleApplicationServer): |
30 class TRSingleApplicationServer(SingleApplicationServer): |
31 """ |
31 """ |
32 Class implementing the single application server embedded within the |
32 Class implementing the single application server embedded within the |
46 """ |
46 """ |
47 SingleApplicationServer.__init__(self, SAFile) |
47 SingleApplicationServer.__init__(self, SAFile) |
48 |
48 |
49 self.parent = parent |
49 self.parent = parent |
50 |
50 |
51 def handleCommand(self, cmd, params): |
51 def handleCommand(self, command, arguments): |
52 """ |
52 """ |
53 Public slot to handle the command sent by the client. |
53 Public slot to handle the command sent by the client. |
54 |
54 |
55 @param cmd commandstring (string) |
55 @param command command sent by the client |
56 @param params parameterstring (string) |
56 @type str |
|
57 @param arguments list of command arguments |
|
58 @type list of str |
57 """ |
59 """ |
58 if cmd == SALoadForm: |
60 if command == SALoadForm: |
59 self.__saLoadForm(eval(params)) |
61 self.__saLoadForm(arguments) |
60 return |
|
61 |
62 |
62 if cmd == SALoadTranslation: |
63 elif command == SALoadTranslation: |
63 self.__saLoadTranslation(eval(params)) |
64 self.__saLoadTranslation(arguments) |
64 return |
|
65 |
65 |
66 def __saLoadForm(self, fnames): |
66 def __saLoadForm(self, fnames): |
67 """ |
67 """ |
68 Private method used to handle the "Load Form" command. |
68 Private method used to handle the "Load Form" command. |
69 |
69 |