コード例 #1
0
ファイル: storage.py プロジェクト: 284928489/zulip
def update_storage(request: HttpRequest, user_profile: UserProfile,
                   storage: Dict[str, str]=REQ(validator=check_dict([]))) -> HttpResponse:
    try:
        set_bot_storage(user_profile, list(storage.items()))
    except StateError as e:
        return json_error(str(e))
    return json_success()
コード例 #2
0
ファイル: storage.py プロジェクト: joydeep1701/zulip
def update_storage(request, user_profile, storage=REQ(validator=check_dict([]))):
    # type: (HttpRequest, UserProfile, Optional[Dict[str, str]]) -> HttpResponse
    try:
        set_bot_storage(user_profile, list(storage.items()))
    except StateError as e:
        return json_error(str(e))
    return json_success()
コード例 #3
0
ファイル: storage.py プロジェクト: yellowjacketsrule/zulip
def update_storage(request,
                   user_profile,
                   storage=REQ(validator=check_dict([]))):
    # type: (HttpRequest, UserProfile, Dict[str, str]) -> HttpResponse
    try:
        set_bot_storage(user_profile, list(storage.items()))
    except StateError as e:
        return json_error(str(e))
    return json_success()
コード例 #4
0
ファイル: storage.py プロジェクト: yurakozlovskiy/zulip
def update_storage(
    request: HttpRequest,
    user_profile: UserProfile,
    storage: Dict[str, str] = REQ(validator=check_dict([], value_validator=check_string)),
) -> HttpResponse:
    try:
        set_bot_storage(user_profile, list(storage.items()))
    except StateError as e:  # nocoverage
        return json_error(str(e))
    return json_success()
コード例 #5
0
ファイル: storage.py プロジェクト: mahimg/zulip
def update_storage(
    request: HttpRequest,
    user_profile: UserProfile,
    storage: Optional[Dict[str, str]] = REQ(validator=check_dict([]))
) -> HttpResponse:
    try:
        set_bot_storage(user_profile, list(storage.items()))
    except StateError as e:
        return json_error(str(e))
    return json_success()
コード例 #6
0
 def put(self, key: str, value: object) -> None:
     set_bot_storage(self.user_profile, [(key, self.marshal(value))])
コード例 #7
0
ファイル: bot_lib.py プロジェクト: brainwane/zulip
 def put(self, key: str, value: str) -> None:
     set_bot_storage(self.user_profile, [(key, self.marshal(value))])
コード例 #8
0
ファイル: bot_lib.py プロジェクト: zonasw/zulip
 def put(self, key: Text, value: Text) -> None:
     set_bot_storage(self.user_profile, [(key, self.marshal(value))])