当前位置: 首页>>代码示例>>Python>>正文


Python Storage.__init__方法代码示例

本文整理汇总了Python中storage.Storage.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Storage.__init__方法的具体用法?Python Storage.__init__怎么用?Python Storage.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在storage.Storage的用法示例。


在下文中一共展示了Storage.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
    def __init__(self, section, cfgfile="tor2web.conf"):
        Storage.__init__(self)

        self._cfgfile = cfgfile
        self._cfgparser = ConfigParser.ConfigParser()
        self._cfgparser.read([self._cfgfile])
        self._section = section
开发者ID:Syd,项目名称:Tor2web-3.0,代码行数:9,代码来源:config.py

示例2: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
 def __init__(
     self,
     db=None,
     tablename='web2py_ticket'
 ):
     Storage.__init__(self)
     self.db = db
     self.tablename = tablename
开发者ID:AlecTaylor,项目名称:openshift_web2py,代码行数:10,代码来源:restricted.py

示例3: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
 def __init__(self, config={}):
     '''
     config["path"] should contain the directory of where to read and write
     data to
     '''
     Storage.__init__(self, config)
     if type(config) is dict and config["path"] is not None:
         self.pickle_filepath = config["path"]
     else:
         self.pickle_filepath = "/tmp/pickle.pickle"
开发者ID:jceaser,项目名称:gcmd_bot,代码行数:12,代码来源:pickle.py

示例4: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
 def __init__(self, cfgfile="/etc/tor2web.conf"):
     Storage.__init__(self)
     self._file = cfgfile
     self._section = 'main'
     self._parser = ConfigParser.ConfigParser()
             
     self.__dict__['nodename'] = 'tor2web'
     self.__dict__['datadir'] = '/home/tor2web'
     self.__dict__['logreqs'] = False
     self.__dict__['debugmode'] = False
     self.__dict__['debugtostdout'] = False
     self.__dict__['processes'] = 1
     self.__dict__['requests_per_process'] = 1000000
     self.__dict__['transport'] = 'BOTH'
     self.__dict__['listen_ipv4'] = '127.0.0.1'
     self.__dict__['listen_ipv6'] = None
     self.__dict__['listen_port_http'] = 80
     self.__dict__['listen_port_https'] = 443
     self.__dict__['basehost'] = 'tor2web.org'
     self.__dict__['sockshost'] = '127.0.0.1'
     self.__dict__['socksport'] = 9050
     self.__dict__['socksoptimisticdata'] = True
     self.__dict__['sockmaxpersistentperhost'] = 5
     self.__dict__['sockcachedconnectiontimeout'] = 240
     self.__dict__['sockretryautomatically'] = True
     self.__dict__['cipher_list'] = 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:' \
                                    'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:' \
                                    'ECDHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:' \
                                    'DES-CBC3-SHA' # this last one (not FS) is kept only for
                                                   # compatibility reasons :/
     self.__dict__['mode'] = 'BLACKLIST'
     self.__dict__['onion'] = None
     self.__dict__['blockcrawl'] = True
     self.__dict__['overriderobotstxt'] = True
     self.__dict__['disable_banner'] = False
     self.__dict__['smtp_user'] = ''
     self.__dict__['smtp_pass'] = ''
     self.__dict__['smtp_mail'] = ''
     self.__dict__['smtpmailto_exceptions'] = ''
     self.__dict__['smtpmailto_notifications'] = ''
     self.__dict__['smtpdomain'] = ''
     self.__dict__['smtpport'] = 587
     self.__dict__['exit_node_list_refresh'] = 600
     self.__dict__['automatic_blocklist_updates_source'] = ''
     self.__dict__['automatic_blocklist_updates_refresh'] = 600
     self.__dict__['mirror'] = []
     self.__dict__['dummyproxy'] = None
开发者ID:alexlauerman,项目名称:Tor2web-3.0,代码行数:49,代码来源:config.py

示例5: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
 def __init__(self, cfgfile="/etc/tor2web.conf"):
     Storage.__init__(self)
     self._file = cfgfile
     self._section = 'main'
     self._parser = ConfigParser.ConfigParser()
             
     self.__dict__['nodename'] = 'tor2web'
     self.__dict__['datadir'] = '/home/tor2web'
     self.__dict__['logreqs'] = False
     self.__dict__['debugmode'] = False
     self.__dict__['debugtostdout'] = False
     self.__dict__['processes'] = 1
     self.__dict__['requests_per_process'] = 200
     self.__dict__['transport'] = 'BOTH'
     self.__dict__['listen_ipv4'] = '127.0.0.1'
     self.__dict__['listen_ipv6'] = None
     self.__dict__['listen_port_http'] = 80
     self.__dict__['listen_port_https'] = 443
     self.__dict__['basehost'] = 'tor2web.org'
     self.__dict__['sockshost'] = '127.0.0.1'
     self.__dict__['socksport'] = 9050
     self.__dict__['socksoptimistidata'] = True
     self.__dict__['sockmaxpersistentperhost'] = 5
     self.__dict__['sockcachedconnectiontimeout'] = 240
     self.__dict__['sockretryautomatically'] = True
     self.__dict__['cipher_list'] = 'DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:RC4-SHA'
     self.__dict__['mode'] = 'BLACKLIST'
     self.__dict__['onion'] = None
     self.__dict__['blockcrawl'] = True
     self.__dict__['overriderobotstxt'] = True
     self.__dict__['disable_banner'] = False
     self.__dict__['smtp_user'] = ''
     self.__dict__['smtp_pass'] = ''
     self.__dict__['smtp_mail'] = ''
     self.__dict__['smtpmailto_exceptions'] = ''
     self.__dict__['smtpmailto_notifications'] = ''
     self.__dict__['smtpdomain'] = ''
     self.__dict__['smtpport'] = 587
     self.__dict__['exit_node_list_refresh'] = 600
     self.__dict__['automatic_blocklist_updates_source'] = ''
     self.__dict__['automatic_blocklist_updates_refresh'] = 600
     self.__dict__['mirrors'] = ['tor2web.org, tor2web.fi',
                                 'tor2web.blutmagie.de',
                                 'onion.sh',
                                 'onion.to']
开发者ID:VasyaRogow,项目名称:Tor2web-3.0,代码行数:47,代码来源:config.py

示例6: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
 def __init__(self):
     Storage.__init__(self)
     self.env = Storage()
     self.cookies = Cookie.SimpleCookie()
     self.get_vars = Storage()
     self.post_vars = Storage()
     self.vars = Storage()
     self.folder = None
     self.application = None
     self.function = None
     self.args = List()
     self.extension = 'html'
     self.now = datetime.datetime.now()
     self.utcnow = datetime.datetime.utcnow()
     self.is_restful = False
     self.is_https = False
     self.is_local = False
     self.global_settings = settings.global_settings
开发者ID:Yefei100,项目名称:eden,代码行数:20,代码来源:globals.py

示例7: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
 def __init__(self, env):
     Storage.__init__(self)
     self.env = Storage(env)
     self.env.web2py_path = global_settings.applications_parent
     self.env.update(global_settings)
     self.cookies = Cookie.SimpleCookie()
     self._get_vars = None
     self._post_vars = None
     self._vars = None
     self.folder = None
     self.application = None
     self.function = None
     self.args = List()
     self.extension = "html"
     self.now = datetime.datetime.now()
     self.utcnow = datetime.datetime.utcnow()
     self.is_restful = False
     self.is_https = False
     self.is_local = False
     self.global_settings = settings.global_settings
开发者ID:jeffreywugz,项目名称:web2py,代码行数:22,代码来源:globals.py

示例8: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
    def __init__(self, file_name):
        Storage.__init__(self)

        self.file_name = file_name
开发者ID:shvets,项目名称:AudioBoo.bundle,代码行数:6,代码来源:file_storage.py

示例9: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
    def __init__(self):
        Storage.__init__(self)
        self._section = 'main'
        self._parser = ConfigParser.ConfigParser()

        parser = OptionParser()
        parser.add_option("-c", "--configfile", dest="configfile", default="/etc/tor2web.conf")
        parser.add_option("-p", "--pidfile", dest="pidfile", default='/var/run/tor2web/t2w.pid')
        parser.add_option("-u", "--uid", dest="uid", default='')
        parser.add_option("-g", "--gid", dest="gid", default='')
        parser.add_option("-n", "--nodaemon", dest="nodaemon", default=False, action="store_true")
        parser.add_option("-d", "--rundir", dest="rundir", default='/var/run/tor2web/')
        parser.add_option("-x", "--command", dest="command", default='start')
        (options, args) = parser.parse_args()

        self._file = options.configfile

        self.__dict__['configfile'] = options.configfile
        self.__dict__['pidfile'] = options.pidfile
        self.__dict__['uid'] = options.uid
        self.__dict__['gid'] = options.gid
        self.__dict__['nodaemon'] = options.nodaemon
        self.__dict__['command'] = options.command
        self.__dict__['nodename'] = 'tor2web'
        self.__dict__['datadir'] = '/home/tor2web'
        self.__dict__['ssl_key'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-key.pem")
        self.__dict__['ssl_cert'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-intermediate.pem")
        self.__dict__['ssl_dh'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-dh.pem")
        self.__dict__['rundir'] = options.rundir
        self.__dict__['logreqs'] = False
        self.__dict__['debugmode'] = False
        self.__dict__['debugtostdout'] = False
        self.__dict__['processes'] = 1
        self.__dict__['requests_per_process'] = 1000000
        self.__dict__['transport'] = 'BOTH'
        self.__dict__['listen_ipv4'] = '127.0.0.1'
        self.__dict__['listen_ipv6'] = None
        self.__dict__['listen_port_http'] = 80
        self.__dict__['listen_port_https'] = 443
        self.__dict__['basehost'] = 'tor2web.org'
        self.__dict__['sockshost'] = '127.0.0.1'
        self.__dict__['socksport'] = 9050
        self.__dict__['socksoptimisticdata'] = True
        self.__dict__['sockmaxpersistentperhost'] = 5
        self.__dict__['sockcachedconnectiontimeout'] = 240
        self.__dict__['sockretryautomatically'] = True
        self.__dict__['cipher_list'] = 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:' \
                                       'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:' \
                                       'ECDHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:' \
                                       'DES-CBC3-SHA' # this last one (not FS) is kept only for
                                                      # compatibility reasons :/
        self.__dict__['mode'] = 'BLACKLIST'
        self.__dict__['onion'] = None
        self.__dict__['blockcrawl'] = True
        self.__dict__['overriderobotstxt'] = True
        self.__dict__['blockhotlinking'] = True
        self.__dict__['blockhotlinking_exts'] = ['jpg', 'png', 'gif']
        self.__dict__['disable_disclaimer'] = False
        self.__dict__['disable_banner'] = False
        self.__dict__['smtp_user'] = ''
        self.__dict__['smtp_pass'] = ''
        self.__dict__['smtp_mail'] = ''
        self.__dict__['smtpmailto_exceptions'] = '[email protected]'
        self.__dict__['smtpmailto_notifications'] = '[email protected]'
        self.__dict__['smtpdomain'] = ''
        self.__dict__['smtpport'] = 587
        self.__dict__['exit_node_list_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_source'] = ''
        self.__dict__['automatic_blocklist_updates_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_mode'] = "MERGE"
        self.__dict__['publish_lists'] = False
        self.__dict__['mirror'] = []
        self.__dict__['dummyproxy'] = None

        # Development VS. Production
        localpath = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", "data"))
        if os.path.exists(localpath):
            self.__dict__['sysdatadir'] = localpath
        else:
            self.__dict__['sysdatadir'] = '/usr/share/tor2web'

        self.load()
开发者ID:Danielweber7624,项目名称:Tor2web-3.0,代码行数:84,代码来源:config.py

示例10: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
 def __init__(self, filename):
     Storage.__init__(self, filename)
     pass
开发者ID:Daniel75,项目名称:repo,代码行数:5,代码来源:watch_later_list.py

示例11: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
    def __init__(self, filename, max_file_size_kb=-1):
        Storage.__init__(self, filename, max_file_size_kb=max_file_size_kb)

        self._enabled = True
        pass
开发者ID:TheLivebox,项目名称:TheLiveBox,代码行数:7,代码来源:function_cache.py

示例12: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
 def __init__(self, cfgfile="/etc/tor2web.conf"):
     Storage.__init__(self)
     self._file = cfgfile
     self._section = 'main'
     self._parser = ConfigParser.ConfigParser()
开发者ID:Hianng,项目名称:Tor2web-3.0,代码行数:7,代码来源:config.py

示例13: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
    def __init__(self):
        Storage.__init__(self)
        self._section = 'main'
        self._parser = ConfigParser.ConfigParser()

        parser = OptionParser()
        parser.add_option("-c", "--configfile", dest="configfile", default="/etc/tor2web.conf")
        parser.add_option("-p", "--pidfile", dest="pidfile", default='/var/run/tor2web/t2w.pid')
        parser.add_option("-u", "--uid", dest="uid", default='')
        parser.add_option("-g", "--gid", dest="gid", default='')
        parser.add_option("-n", "--nodaemon", dest="nodaemon", default=False, action="store_true")
        parser.add_option("-d", "--rundir", dest="rundir", default='/var/run/tor2web/')
        parser.add_option("-x", "--command", dest="command", default='start')
        options, _ = parser.parse_args()

        self._file = options.configfile

        self.__dict__['configfile'] = options.configfile
        self.__dict__['pidfile'] = options.pidfile
        self.__dict__['uid'] = options.uid
        self.__dict__['gid'] = options.gid
        self.__dict__['nodaemon'] = options.nodaemon
        self.__dict__['command'] = options.command
        self.__dict__['nodename'] = 'tor2web'
        self.__dict__['datadir'] = '/home/tor2web'
        self.__dict__['sysdatadir'] = '/usr/share/tor2web/data'
        self.__dict__['ssl_key'] = None
        self.__dict__['ssl_cert'] = None
        self.__dict__['ssl_intermediate'] = None
        self.__dict__['ssl_dh'] = None
        self.__dict__['rundir'] = options.rundir
        self.__dict__['logreqs'] = False
        self.__dict__['debugmode'] = False
        self.__dict__['debugtostdout'] = False
        self.__dict__['processes'] = 1
        self.__dict__['requests_per_process'] = 1000000
        self.__dict__['transport'] = 'BOTH'
        self.__dict__['listen_ipv4'] = '127.0.0.1'
        self.__dict__['listen_ipv6'] = None
        self.__dict__['listen_port_http'] = 80
        self.__dict__['listen_port_https'] = 443
        self.__dict__['basehost'] = 'tor2web.org'
        self.__dict__['sockshost'] = '127.0.0.1'
        self.__dict__['socksport'] = 9050
        self.__dict__['socksoptimisticdata'] = True
        self.__dict__['sockmaxpersistentperhost'] = 5
        self.__dict__['sockcachedconnectiontimeout'] = 240
        self.__dict__['sockretryautomatically'] = True
        self.__dict__['cipher_list'] = 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:' \
                                       'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:' \
                                       'ECDHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:'
        self.__dict__['ssl_tofu_cache_size'] = 100
        self.__dict__['mode'] = 'BLOCKLIST'
        self.__dict__['onion'] = None
        self.__dict__['blockcrawl'] = True
        self.__dict__['overriderobotstxt'] = True
        self.__dict__['blockhotlinking'] = True
        self.__dict__['blockhotlinking_exts'] = ['jpg', 'png', 'gif']
        self.__dict__['deny_caching'] = True
        self.__dict__['extra_http_response_headers'] = None
        self.__dict__['disable_disclaimer'] = False
        self.__dict__['disable_banner'] = False
        self.__dict__['disable_tor_redirection'] = False
        self.__dict__['disable_gettor'] = False
        self.__dict__['avoid_rewriting_visible_content'] = False
        self.__dict__['smtpuser'] = 'hey_you_should_change_me'
        self.__dict__['smtppass'] = 'yes_you_really_should_change_me'
        self.__dict__['smtpmail'] = '[email protected]'
        self.__dict__['smtpmailto_exceptions'] = '[email protected]'
        self.__dict__['smtpmailto_notifications'] = '[email protected]'
        self.__dict__['smtpdomain'] = 'demo.globaleaks.org'
        self.__dict__['smtpport'] = 9267
        self.__dict__['smtpsecurity'] = 'TLS'
        self.__dict__['exit_node_list_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_source'] = ''
        self.__dict__['automatic_blocklist_updates_refresh'] = 600
        self.__dict__['automatic_blocklist_updates_mode'] = "MERGE"
        self.__dict__['publish_lists'] = False
        self.__dict__['mirror'] = []
        self.__dict__['dummyproxy'] = None
        self.__dict__['proto'] = 'http://' if self.__dict__['transport'] == 'HTTP' else 'https://'
        self.__dict__['bufsize'] = 4096

        # Development VS. Production
        localpath = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", "data"))
        if os.path.exists(localpath):
            self.__dict__['sysdatadir'] = localpath

        self.load()

        if self.__dict__['ssl_key'] is None:
            self.__dict__['ssl_key'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-key.pem")

        if self.__dict__['ssl_cert'] is None:
            self.__dict__['ssl_cert'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-cert.pem")

        if self.__dict__['ssl_intermediate'] is None:
            self.__dict__['ssl_intermediate'] = os.path.join(self.__dict__['datadir'], "certs/tor2web-intermediate.pem")

        if self.__dict__['ssl_dh'] is None:
#.........这里部分代码省略.........
开发者ID:wtf,项目名称:Tor2web,代码行数:103,代码来源:config.py

示例14: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
    def __init__(self, file_name):
        Storage.__init__(self, file_name)

        self.load()
开发者ID:shvets,项目名称:music-plex-plugin,代码行数:6,代码来源:plex_storage.py

示例15: __init__

# 需要导入模块: from storage import Storage [as 别名]
# 或者: from storage.Storage import __init__ [as 别名]
 def __init__(self):
     """
     Create an storage instance passing an Amazon S3 connection
     """
     Storage.__init__(self, Connection().s3_connection())
开发者ID:reneses,项目名称:cloud-cli,代码行数:7,代码来源:storage_aws.py


注:本文中的storage.Storage.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。