本文整理汇总了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]
示例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))
示例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
示例4: __init__
# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import __init__ [as 别名]
def __init__(self):
Backend.__init__(self, rhnSQL)
示例5: __init__
# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import __init__ [as 别名]
def __init__(self, engine_config):
Backend.__init__(self, engine_config)
示例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()
示例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