Hi Gerhard, Maybe it's not the best way to handle this, but I generally create custom command-line scripts (using Buildout) and just check for sys.argv...
Best regards, Thierry -- https://www.ulthar.net -- http://pyams.readthedocs.io Le ven. 13 oct. 2023 à 07:00, Gerhard Schmidt <[email protected]> a écrit : > Hi there, > > I'm often running into the problem to determinate if the current app is > running as a server to server http requests or created from a console > script to do specific things. > > Mostly it's to decide if a background thread should be started (needed > in the Server) or not (can cause problems in the console script) in the > ApplicationCreated event. > > I'm using pyramid.paster.bootstrap to set up the app for a console script. > > The problem is, the ApplicationCreated is called before I have a chance > to set anything in the registry to pass information along. > > I there a clean way know from the app object passed to the event alone. > I tried to pass a custom Request to bootstrap but the request is not > passed to this event. > > Regards > Estartu > > > > > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/pylons-discuss/008829c9-1180-4365-9f69-d22d59a09ccd%40augusta.de > . > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAPX_VWDw%2BMWKioj5F_OBpeeBSNJAS3JAoU8DZmNsZ3hRX-x%3DAg%40mail.gmail.com.
