小编Dew*_*wey的帖子

app engine python gcloud没有更新实例

在此输入图像描述在此输入图像描述我一直在运行这个命令:

gcloud app deploy service_backend.yaml --stop-previous-version --version test-0-5-8

一遍又一遍(每次都增加最终的版本数字),每次都去查看我的代码中的日志输出,它显示我从PRIOR /早期版本的代码中记录,但列在"test-0-5-"下面8"版本

或者我正在失去理智或者发生了一些非常奇怪的事情我在发布这个令人尴尬的问题之前已经尝试了30次,因为我认为我必须以某种方式造成这种情况,但我完全不知道如何

python versioning google-app-engine gcloud

15
推荐指数
1
解决办法
310
查看次数

Gcloud更新破坏了我的应用程序-GCP Python 2.7

我刚刚升级了GCloud,现在无法启动我的开发环境。

gcloud --version

  • Google Cloud SDK 238.0.0
  • 应用引擎
  • app-engine-python 1.9.84
  • app-engine-python-extras 1.9.74 beta 2019.02.22
  • bq 2.0.42
  • 云数据存储模拟器2.1.0
  • 核心2019.03.08
  • gsutil 4.37

我不理解这些错误...感谢所有反馈!

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)

python google-app-engine google-cloud-platform gcloud

6
推荐指数
1
解决办法
344
查看次数

像字典一样搜索一个namedtuple

为了节省内存并避免冗余数据库存储(可能是预优化),我使用的是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错误.

python search namedtuple

5
推荐指数
1
解决办法
5057
查看次数