gcloud app deploy service_backend.yaml --stop-previous-version --version test-0-5-8
一遍又一遍(每次都增加最终的版本数字),每次都去查看我的代码中的日志输出,它显示我从PRIOR /早期版本的代码中记录,但列在"test-0-5-"下面8"版本
或者我正在失去理智或者发生了一些非常奇怪的事情我在发布这个令人尴尬的问题之前已经尝试了30次,因为我认为我必须以某种方式造成这种情况,但我完全不知道如何
我刚刚升级了GCloud,现在无法启动我的开发环境。
gcloud --version
我不理解这些错误...感谢所有反馈!
WARNING 2019-03-13 20:38:17,348 multistore_file.py:62] The oauth2client.contrib.multistore_file module has been deprecated and will be removed in the next release of oauth2client. Please migrate to multiprocess_file_storage.
ERROR 2019-03-13 20:38:17,586 wsgi.py:263]
Traceback (most recent call last):
File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/Users/dgaedcke/gcloud_tools/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 96, in LoadObject …Run Code Online (Sandbox Code Playgroud) 为了节省内存并避免冗余数据库存储(可能是预优化),我使用的是namedtuple而不是字典.
但我需要搜索recs的集合,我的字典方法是:
import operator
def query(D,key,val, keynotfound=None):
'''
D: a list of dictionaries (but I want it to be namedtuples)
key: the key to query
val: the value to search for
keynotfound: value if key is not found
Returns elements in D such that operator(D.get(key,None), val) is true
'''
op = operator.eq
def try_op(f,x,y):
try:
return f(x,y)
except Exception, exc:
return False
return (x for x in D if try_op(op, x.get(key,keynotfound),val))
Run Code Online (Sandbox Code Playgroud)
没有在namedtuple上工作任何关于如何子类化namedtuple以使其像dict一样可搜索的技巧?并非每个实例都包含与查询键相同的键/字段,因此我需要跳过该行而不是抛出键/ attr错误.