How to disable gae python to check for updates every time I start a server in eclipse?

后端 未结 3 629
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-13 09:37

I just hate seeing this for 20sec every time I run my server: appcfg.py:393] Checking for updates to the SDK.

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-13 10:05

    @Nick Jognson and @Joe answers both for me did not worked but here is how i fixed it for ENTERPRISES where user names get deleted and user profile gets deleted on every reboot.

    #!/usr/bin/env python
    from subprocess import Popen, PIPE 
    cmd = Popen('python.exe script.py', stdout=PIPE, stdin=PIPE, stderr=PIPE) 
    out, err = cmd.communicate("sendNOnENTER\nsendNOnENTER\n")
    print out
    print err
    

    Here script.py is executed and if it was asked to type Y or n you can use communicate method or second method is little bit nonsense but also works:

    import os
    from subprocess import Popen
    google_app_engine_update = 'c:/Python27/.appcfg_nag'
    if os.path.exists(google_app_engine_update):
      target = open(google_app_engine_update, 'r+')
    else:
      target = open(google_app_engine_update, 'w')
    
    line1 = 'opt_in: false'
    target.write(line1)
    target.close()
    Popen(['c:/Python27/python.exe', 'C:/google/devscript.py', arg1, arg2], shell=False)
    

提交回复
热议问题