⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.23
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python2.7
/
site-packages
/
offlineimap
/
utils
/
View File Name :
const.py
# Copyright (C) 2013-2014 Eygene A. Ryabinkin and contributors # # Collection of classes that implement const-like behaviour # for various objects. import copy class ConstProxy(object): """Implements read-only access to a given object that can be attached to each instance only once.""" def __init__(self): self.__dict__['__source'] = None def __getattr__(self, name): src = self.__dict__['__source'] if src == None: raise ValueError("using non-initialized ConstProxy() object") return copy.deepcopy(getattr(src, name)) def __setattr__(self, name, value): raise AttributeError("tried to set '%s' to '%s' for constant object"% \ (name, value)) def __delattr__(self, name): raise RuntimeError("tried to delete field '%s' from constant object"% \ (name)) def set_source(self, source): """ Sets source object for this instance. """ if (self.__dict__['__source'] != None): raise ValueError("source object is already set") self.__dict__['__source'] = source