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


Python Base.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
    def __init__(self, manager, loginname, password, options):
        Base.__init__(self, manager.core)

        if "activated" in options:
            activated = from_string(options["activated"], "bool")
        else:
            activated = Account.activated

        for opt in self.known_opt:
            if opt not in options:
                options[opt] = ""

        for opt in options.keys():
            if opt not in self.known_opt:
                del options[opt]

        # default account attributes
        AccountInfo.__init__(self, self.__name__, loginname, Account.valid, Account.validuntil, Account.trafficleft,
            Account.maxtraffic, Account.premium, activated, options)

        self.manager = manager

        self.lock = RLock()
        self.timestamp = 0
        self.login_ts = 0 # timestamp for login
        self.cj = CookieJar(self.__name__)
        self.password = password
        self.error = None

        self.init()
开发者ID:beefone,项目名称:pyload,代码行数:32,代码来源:Account.py

示例2: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
    def __init__(self, core, package=None, password=None):
        Base.__init__(self, core)

        self.req = None
        # load account if set
        if self.USE_ACCOUNT:
            self.account = self.core.accountManager.selectAccount(self.USE_ACCOUNT, self.user)
            if self.account:
                self.req = self.account.getAccountRequest()

        if self.req is None:
            self.req = core.requestFactory.getRequest()

        # Package the plugin was initialized for, don't use this, its not guaranteed to be set
        self.package = package
        #: Password supplied by user
        self.password = password
        #: Propose a renaming of the owner package
        self.rename = None

        # For old style decrypter, do not use these!
        self.packages = []
        self.urls = []
        self.pyfile = None

        self.init()
开发者ID:eliasgraf,项目名称:pyload,代码行数:28,代码来源:Crypter.py

示例3: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
    def __init__(self, core, manager, user=None):
        Base.__init__(self, core, user)

        #: Callback of periodical job task, used by addonManager
        self.cb = None

        #: `AddonManager`
        self.manager = manager

        #register events
        if self.event_map:
            for event, funcs in self.event_map.iteritems():
                if type(funcs) in (list, tuple):
                    for f in funcs:
                        self.evm.listenTo(event, getattr(self, f))
                else:
                    self.evm.listenTo(event, getattr(self, funcs))

            #delete for various reasons
            self.event_map = None

        self.init()

        # start periodically if set
        self.startPeriodical(self.interval, 0)
开发者ID:vta1201,项目名称:pyload,代码行数:27,代码来源:Addon.py

示例4: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
 def __init__(self, localDownloadQueue = "PendingDownloadQueue"):
     Base.__init__(self)
     self.download_queue = localDownloadQueue
     self.ftp_sync = FileSyncer()
     self.move_file_into_processing()
     Extractor(self.local_directory_to_sync)
     Cleaner(self.local_directory_to_sync)
开发者ID:m4l1c3,项目名称:Python-FTP-Sync,代码行数:9,代码来源:DownloadProcessor.py

示例5: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
    def __init__(self, manager, loginname, password, options):
        Base.__init__(self, manager.core)

        if "activated" in options:
            self.activated = from_string(options["activated"], "bool")
        else:
            self.activated = Account.activated

        for opt in self.known_opt:
            if opt not in options:
                options[opt] = ""

        for opt in options.keys():
            if opt not in self.known_opt:
                del options[opt]

        self.loginname = loginname
        self.options = options

        self.manager = manager

        self.lock = RLock()
        self.timestamp = 0
        self.login_ts = 0 # timestamp for login
        self.cj = CookieJar(self.__name__)
        self.password = password
        self.error = None

        self.init()
开发者ID:Dinawhk,项目名称:pyload,代码行数:31,代码来源:Account.py

示例6: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
    def __init__(self, core, manager, user=None):
        Base.__init__(self, core, user)

        #: Provide information in dict here, usable by API `getInfo`
        self.info = None

        #: Callback of periodical job task, used by addonmanager
        self.cb = None

        #: `AddonManager`
        self.manager = manager

        #register events
        if self.event_map:
            for event, funcs in self.event_map.iteritems():
                if type(funcs) in (list, tuple):
                    for f in funcs:
                        self.evm.addEvent(event, getattr(self,f))
                else:
                    self.evm.addEvent(event, getattr(self,funcs))

            #delete for various reasons
            self.event_map = None

        if self.event_list:
            for f in self.event_list:
                self.evm.addEvent(f, getattr(self,f))

            self.event_list = None

        self.initPeriodical()
        self.init()
        self.setup()
开发者ID:4Christopher,项目名称:pyload,代码行数:35,代码来源:Addon.py

示例7: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
	def __init__(self, spec):
		Base.__init__(self)
		self.spec = spec
		self.tags = {}
		self.macros = {}
		self.subpackages = {}
		self.changelogs = []
开发者ID:gofed,项目名称:gofed,代码行数:9,代码来源:SpecParser.py

示例8: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
 def __init__(self,pgString="",f=""):
     Base.__init__(self)
     self.pgString=pgString
     if os.path.exists(f):
         os.remove(f)
     self.f=open(f,'w')
     self.osmids={}
     #self.__connect()
     #self.logger.info("creating new file")
     pass
开发者ID:riyastir,项目名称:openaddresses,代码行数:12,代码来源:OA.py

示例9: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
	def __init__(self):
		Base.__init__(self)
		
		self.listing_data_object_path = os.path.join(
			self.data_object_path, 'category_list.p')
		self.category_done_list_object_path = os.path.join(
			self.data_path, 'category_done_list.p')

		self.category_list = {}
		self.category_done_list = []
		self.categories = CATEGORIES
开发者ID:jaindeepali,项目名称:Adler,代码行数:13,代码来源:Category.py

示例10: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
    def __init__(self, pyfile):
        Base.__init__(self, pyfile.m.core)

        self.wantReconnect = False
        #: enables simultaneous processing of multiple downloads
        self.limitDL = 0
        #: chunk limit
        self.chunkLimit = 1
        #: enables resume (will be ignored if server dont accept chunks)
        self.resumeDownload = False

        #: plugin is waiting
        self.waiting = False

        self.ocr = None  #captcha reader instance
        #: account handler instance, see :py:class:`Account`
        self.account = self.core.accountManager.getAccountForPlugin(self.__name__)

        #: premium status
        self.premium = False
        #: username/login
        self.user = None

        if self.account and not self.account.isUsable(): self.account = None
        if self.account:
            self.user = self.account.loginname
            #: Browser instance, see `network.Browser`
            self.req = self.account.getAccountRequest()
            # Default:  -1, True, True
            self.chunkLimit, self.limitDL, self.resumeDownload = self.account.getDownloadSettings()
            self.premium = self.account.isPremium()
        else:
            self.req = self.core.requestFactory.getRequest(klass=self.REQUEST_CLASS)

        #: Will hold the download class
        self.dl = None

        #: associated pyfile instance, see `PyFile`
        self.pyfile = pyfile
        self.thread = None # holds thread in future

        #: location where the last call to download was saved
        self.lastDownload = ""
        #: re match of the last call to `checkDownload`
        self.lastCheck = None
        #: js engine, see `JsEngine`
        self.js = self.core.js

        self.retries = 0 # amount of retries already made
        self.html = None # some plugins store html code here

        self.init()
开发者ID:DasLampe,项目名称:pyload,代码行数:54,代码来源:Hoster.py

示例11: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
	def __init__(self, verbose=False, cache=False, loops=False):
		Base.__init__(self)
		self.warn = []
		self.verbose = verbose
		self.cache = cache
		self.loops = loops
		# list of package names
		self.nodes = []
		# adjacency list
		self.edges = {}
		# {..., 'subpackage': 'package', ...}
		# subpackage \in package relationship
		self.pkg_devel_main_pkg = {}
开发者ID:nullr0ute,项目名称:gofed,代码行数:15,代码来源:DependencyGraphBuilder.py

示例12: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
    def __init__(self, core, manager, user=None):
        Base.__init__(self, core, user)

        #: Callback of periodical job task, used by addonManager
        self.cb = None

        #: `AddonManager`
        self.manager = manager

        self.init()

        # start periodically if set
        self.startPeriodical(self.interval, 0)
开发者ID:ASCIIteapot,项目名称:pyload,代码行数:15,代码来源:Addon.py

示例13: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
 def __init__(self,XAPIurl="",bbox="",maxSize=1):
     Base.__init__(self)
     self.url=XAPIurl
     self.bbox=bbox
     self.maxSize=float(maxSize)
     self.requests=[]
     if len(bbox)>0:
         self.bboxes=self.__getBBoxes()
         for bboxParam in self.bboxes:
             self.requests.append("%s*[addr:housenumber]%s" % (self.url,bboxParam))
     else:
         bboxParam=""
         self.requests.append("%s*[addr:housenumber]%s" % (self.url,bboxParam))
     pass
开发者ID:riyastir,项目名称:openaddresses,代码行数:16,代码来源:OSM.py

示例14: __init__

# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import __init__ [as 别名]
    def __init__(self, path_to_clean, acceptable_file_types = ''):
        Base.__init__(self)
        if not acceptable_file_types == '':
            self.acceptable_file_types = acceptable_file_types

        self.path_to_clean = path_to_clean

        if not self.path_to_clean == '':
            try:
                for folder in os.listdir(self.path_to_clean):
                    self.check_file(folder)
            except Exception as e:
                Logger("Error cleaning up - " + str(e))
        else:
            Logger("Error - no path to clean defined.")
开发者ID:m4l1c3,项目名称:Python-FTP-Sync,代码行数:17,代码来源:Cleaner.py

示例15: __init__

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

		self.import_path_prefix = self.parser_config.getImportPathPrefix()
		self.skip_errors = self.parser_config.skipErrors()
		self.noGodeps = self.parser_config.getNoGodeps()
		# if set scan only some packages (and all direct/indirect imported local packages)
		self.partial = self.parser_config.isPartial()
		self.included_packages = self.parser_config.getPartial()
		self.marked_nodes = {}
		self.partial_nodes = {}

		self.api = None
		self.nodes = []
		self.edges = {}
开发者ID:jedahan,项目名称:gofed,代码行数:18,代码来源:ProjectDecompositionGraphBuilder.py


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