How to use the atelier.utils.SubProcessParent function in atelier

To help you get started, we’ve selected a few atelier examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lino-framework / lino / lino / management / commands / makescreenshots.py View on Github external
def main(self, force=False, **kw):
        settings.SITE.startup()

        outputbase = os.path.join(settings.MEDIA_ROOT, 'cache', 'screenshots')

        urlbase = "http://" + ADDR + ":" + str(PORT)
        #~ urlbase="http://127.0.0.1:8000"
        pp = SubProcessParent()
        server = Process(target=self.start_server)
        server.start()
        #~ server.join()
        logger.info("started the server")

        count = 0
        assert not settings.SITE.remote_user_header
        try:
            for lng in settings.SITE.languages:
                if lng.django_code == 'de':  # temporary
                    for ss in screenshots.get_screenshots(lng.django_code):
                    #~ print "20130515 got screenshot", ss
                        target = ss.get_filename(outputbase)
                        if not force and os.path.exists(target):
                            logger.info("%s exists", target)
                            continue