Loading src/yapsut/cookies.py +10 −3 Original line number Diff line number Diff line Loading @@ -187,15 +187,22 @@ class cookies_collection : return self._list.keys() # def __setitem__(self,this,that) : print(type(that),type(cookie()),type(that)==type(cookie())) if type(that) != type({}) and type(that) != type(cookie()) : raise Exception(f'content of {this} must be a dictionary or a cookie') if type(that) == type({}) : ic=cookie() ic.from_dict(that) self._list[this]=ic else : self._list[this]=that ic=that if this is None : n=ic.name elif type(this)!=type('') : raise Exception('this must be a string') elif this.strip() == '' : n=ic.name else : n=this.strip() self._list[n]=ic # def __getitem__(self,this) : if type(this) == type(int) : Loading Loading
src/yapsut/cookies.py +10 −3 Original line number Diff line number Diff line Loading @@ -187,15 +187,22 @@ class cookies_collection : return self._list.keys() # def __setitem__(self,this,that) : print(type(that),type(cookie()),type(that)==type(cookie())) if type(that) != type({}) and type(that) != type(cookie()) : raise Exception(f'content of {this} must be a dictionary or a cookie') if type(that) == type({}) : ic=cookie() ic.from_dict(that) self._list[this]=ic else : self._list[this]=that ic=that if this is None : n=ic.name elif type(this)!=type('') : raise Exception('this must be a string') elif this.strip() == '' : n=ic.name else : n=this.strip() self._list[n]=ic # def __getitem__(self,this) : if type(this) == type(int) : Loading