예제 #1
0
def get_storage(request, user_profile, keys=REQ(validator=check_list(check_string), default=None)):
    # type: (HttpRequest, UserProfile, Optional[List[str]]) -> HttpResponse
    keys = keys or get_keys_in_bot_storage(user_profile)
    try:
        storage = {key: get_bot_storage(user_profile, key) for key in keys}
    except StateError as e:
        return json_error(str(e))
    return json_success({'storage': storage})
예제 #2
0
파일: storage.py 프로젝트: mahimg/zulip
def get_storage(request,
                user_profile,
                keys=REQ(validator=check_list(check_string), default=None)):
    # type: (HttpRequest, UserProfile, Optional[List[str]]) -> HttpResponse
    keys = keys or get_keys_in_bot_storage(user_profile)
    try:
        storage = {key: get_bot_storage(user_profile, key) for key in keys}
    except StateError as e:
        return json_error(str(e))
    return json_success({'storage': storage})
예제 #3
0
def get_storage(
    request: HttpRequest,
    user_profile: UserProfile,
    keys: Optional[List[str]] = REQ(json_validator=check_list(check_string),
                                    default=None),
) -> HttpResponse:
    keys = keys or get_keys_in_bot_storage(user_profile)
    try:
        storage = {key: get_bot_storage(user_profile, key) for key in keys}
    except StateError as e:
        return json_error(str(e))
    return json_success({"storage": storage})
예제 #4
0
 def get(self, key: str) -> object:
     return self.demarshal(get_bot_storage(self.user_profile, key))
예제 #5
0
파일: bot_lib.py 프로젝트: brainwane/zulip
 def get(self, key: str) -> str:
     return self.demarshal(get_bot_storage(self.user_profile, key))
예제 #6
0
 def get(self, key: Text) -> Text:
     return self.demarshal(get_bot_storage(self.user_profile, key))
예제 #7
0
파일: bot_lib.py 프로젝트: zonasw/zulip
 def get(self, key: Text) -> Text:
     return self.demarshal(get_bot_storage(self.user_profile, key))