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


Python Backend.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import __init__ [as 别名]
    def __init__(self, *fargs, **args):
        Backend.__init__(self, *fargs, **args)

        if "log_path" in args:
            if "debug" in args:
                self.debug = args["debug"]
            else:
                self.debug = True
        else:
            self.debug = False

        if self.debug:
            self.setup_logfile("dbpedia", args["log_path"])

        if "backend" in args:
            self.set_backend(args["backend"])
        else:
            self.set_backend(self.default_backend)
        
        if len(fargs) > 1:
            if type(fargs[0]) == str:
                self.request = fargs
            else:
                print('fixme', fargs)
                sys.exit()
        else:
            self.request = fargs
        if type(self.request)  == tuple:
            self.request = self.request[0]
开发者ID:STITCHplus,项目名称:easy_linked_open_data_access,代码行数:31,代码来源:dbpedia.py

示例2: __init__

# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import __init__ [as 别名]
 def __init__(self, engine_config):
   Backend.__init__(self, engine_config)
   try:
     self.con = MySQLdb.connect(host=dbhost,
                                user=dbuser,
                                passwd=dbpass,
                                db=dbname,
                                charset='utf8')
     self.logger.info("Connected to MySQL db %s:%s." % (dbhost, dbname))
     self.cur = self.con.cursor()
   except Exception as e:
     raise BackendError("Error connecting to MySQL db %s:%s: %s" % (dbhost, dbname, e))
开发者ID:biancini,项目名称:TwitterAnalyzer,代码行数:14,代码来源:mysqlbackend.py

示例3: __init__

# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import __init__ [as 别名]
    def __init__(self, host):
        Backend.__init__(self, host)
        ThreadMessaging(self)

        self.LINUXMIN = 5.0     # GB, guessed min. space requirement for Linux

        # The following flag declarations serve two purposes:
        #  1) Show which flags are available
        #  2) Show the defaults ('on' is capitalized)
        # Flags used to affect partition formatting (fs-type dependent usage):
        # ext3/4::: i:directory indexing, f: full journal
        self.FORMATFLAGS = "If"
        # Flags used to set mount options in /etc/fstab:
        # a: noatime, m: noauto
        self.MOUNTFLAGS = "Am"
        # Default file-system for automatic partitioning
        self.DEFAULTFS = "ext3"

        # Available file-systems for formatting
        self.filesystems = ['ext3', 'ext4', 'reiserfs', 'ext2', 'jfs', 'xfs']
        # List of mount-point suggestions
        self.mountpoints = ['---', '/', '/home', '/boot', '/var',
                '/opt', '/usr']

        # By default use UUID for partitions, and for swap (if
        # there is one). A problem with using UUID for swaps is that the
        # partition might get reformatted by another installation,
        # which would probably change the UUID!
        self.use_uuid = True
        self.use_uuid_swap = True

        # Create a directory for temporary files
        shutil.rmtree("/tmp/larchin", True)
        os.mkdir("/tmp/larchin")

        # For inter-thread communication of errors, etc.
        self.error = None
        self.interrupt = None
开发者ID:BackupTheBerlios,项目名称:larch,代码行数:40,代码来源:install.py

示例4: __init__

# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import __init__ [as 别名]
 def __init__(self):
     Backend.__init__(self, rhnSQL)
开发者ID:renner,项目名称:spacewalk,代码行数:4,代码来源:backendOracle.py

示例5: __init__

# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import __init__ [as 别名]
 def __init__(self, engine_config):
   Backend.__init__(self, engine_config)
开发者ID:biancini,项目名称:TwitterAnalyzer,代码行数:4,代码来源:elasticsearchbackend.py

示例6: __init__

# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import __init__ [as 别名]
 def __init__(self, serviceFullName, workDirTop, resultUrlTop, config, debug=False):
     Backend.__init__(self, serviceFullName, workDirTop, resultUrlTop, config, debug=debug)
     self.copier = Copier()
开发者ID:davidraythompson,项目名称:hsifind,代码行数:5,代码来源:executable.py

示例7: __init__

# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import __init__ [as 别名]
	def __init__(self, name=None, out_queue=None, root_dir=None):
		Backend.__init__(self, name, out_queue)
		self.root_dir = root_dir
开发者ID:Mysingen,项目名称:dwite,代码行数:5,代码来源:backend_fs.py


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