<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Dear Glyph and All<br>
    <br>
    I see a reply to my question via
    <a class="moz-txt-link-freetext" href="http://twistedmatrix.com/pipermail/twisted-python/2012-January/025076.html">http://twistedmatrix.com/pipermail/twisted-python/2012-January/025076.html</a>
    but I didn't receive it in my mail box (is there a problem with this
    list).<br>
    <br>
    Thankyou for your reply.<br>
    <br>
    Yes, I want it to run that script as .tac file.<br>
    Actualy I just need the wx part as "display" only. There is no
    "input" activity via WX.<br>
    My system will serve a driver. so the input part will use
    pushbuttons that will conected to USB via ArduinoBoard.<br>
    Thats why there is some previous post by me asking about combining
    serial with wokkel ... and I got Great enlightment from this list.<br>
    <br>
    From the script that combine wokkel and Arduino board .. I got
    knowlede on how to add more service to exixting twisted script using
    service.MultiService()
    and service.Application()<br>
    <br>
    Basicaly I need to write a script that :<br>
    1. Display a base screen/panel/window when started <br>
    2. wait for command input via TCP/UDP/UnixSocket in JSON format<br>
    3. update the display based on variables inside incoming command<br>
    <br>
    And if it not to much ... i prefer using twisted .tac file and
    service.MultiService()
    and service.Application().<br>
    <br>
    Sincerely<br>
    -bino-<br>
    <br>
    <br>
    <b></b>On 01/09/2012 12:39 PM, bino oetomo wrote:
    <blockquote cite="mid:4F0A7D74.9030500@indoakses-online.com"
      type="cite">Dear All ...
      <br>
      <br>
      I just copy and paste the code from
      <a class="moz-txt-link-freetext" href="http://code.activestate.com/recipes/298985/">http://code.activestate.com/recipes/298985/</a>
      <br>
      and adding lines :
      <br>
      --------------
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.allowNone = True
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.useDateTime = False
      <br>
      --------------
      <br>
      just before line#&nbsp; 45,
      <br>
      and it work great.
      <br>
      <br>
      I need to adopting that script to my application, but I'm not
      familiar with code line 64-78 :
      <br>
      --------------------
      <br>
      if __name__ == '__main__':
      <br>
      <br>
      &nbsp;&nbsp;&nbsp; # Initiliaze MyApp
      <br>
      &nbsp;&nbsp;&nbsp; app = MyXMLRPCApp(False) # False -&gt; printing stdout/stderr
      to shell,
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # not in an additional wx window
      <br>
      <br>
      &nbsp;&nbsp;&nbsp; # Make wx application twisted aware
      <br>
      &nbsp;&nbsp;&nbsp; # Must have to start "wxreactor.install()" on top before
      <br>
      &nbsp;&nbsp;&nbsp; reactor.registerWxApp(app)
      <br>
      <br>
      &nbsp;&nbsp;&nbsp; # Make a XML-RPC Server listening to port 7080
      <br>
      &nbsp;&nbsp;&nbsp; reactor.listenTCP(7080, server.Site(app))
      <br>
      -------------------
      <br>
      <br>
      How to migrate that script to twistd, something like :
      <br>
      ------------------
      <br>
      #Create Application
      <br>
      application = service.Application("MultiService Example")
      <br>
      #Create xmlrpc site
      <br>
      myrpc = MyRPC()
      <br>
      site = server.Site(myrpc)
      <br>
      myrpcservice = internet.TCPServer(50008, site,
      interface='localhost')
      <br>
      #Creating Multi Service
      <br>
      multiService = service.MultiService()
      <br>
      #Add our Services to multiservice
      <br>
      myrpcservice.setServiceParent(multiService)
      <br>
      #Set created application to be serviceparent of multiservice
      <br>
      multiService.setServiceParent(application)
      <br>
      ------------------
      <br>
      <br>
      Kindly please give me your enlightment.
      <br>
      <br>
      Sincerely
      <br>
      -bino-
      <br>
      <br>
    </blockquote>
    <br>
  </body>
</html>