omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Stopping SimpleHTTPServer

    Editorial
    3
    4
    2694
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • emkay
      emkay last edited by

      I am using SimpleHTTPServer in an Editorial workflow. This works well, except the stop button and the spinning button do not kill the workflow.

      The background timeout will kill the workflow, but I am unable to do it manually.

      Can anyone help?

      Thanks

      Martin

      1 Reply Last reply Reply Quote 0
      • filippocld223
        filippocld223 last edited by

        what about stopping the workflow with a raw input?

        exit=raw_input("Do you want to exit?")
        if exit=="yes":
            sys.exit()
        
        1 Reply Last reply Reply Quote 0
        • emkay
          emkay last edited by

          Thanks for the idea, but it am running the example at the end http://omz-software.com/editorial/docs/library/simplehttpserver.html

          There isn't a place to put the raw_input.

          I'll keep hunting for ways to stop it (it stops under pythonista, so I'm sure there is a way).

          Martin

          1 Reply Last reply Reply Quote 0
          • ccc
            ccc last edited by

            Two approaches to consider:

            1. avoid serve_ forever() http://docs.python.org/2/library/basehttpserver.html#more-examples
            2. threading http://stackoverflow.com/questions/11493985/python-basehttpserver-how-to-get-it-to-stop
            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors