예제 #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
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
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
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))])