浏览代码

Support deep/multiple inheritance from Item

tags/v0.2.1
JustAnotherArchivist 4 年前
父节点
当前提交
08d96b37c5
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. +6
    -0
      qwarc/__init__.py
  2. +1
    -1
      qwarc/cli.py

+ 6
- 0
qwarc/__init__.py 查看文件

@@ -135,6 +135,12 @@ class Item:
def clear_subitems(self):
self.childItems = []

@classmethod
def get_subclasses(cls):
for subclass in cls.__subclasses__():
yield subclass
yield from subclass.get_subclasses()


class QWARC:
def __init__(self, itemClasses, warcBasePath, dbPath, command, specFile, specDependencies, logFilename, concurrency = 1, memoryLimit = 0, minFreeDisk = 0, warcSizeLimit = 0, warcDedupe = False):


+ 1
- 1
qwarc/cli.py 查看文件

@@ -65,7 +65,7 @@ def main():
specDependencies = specMod.__dict__.get('specDependencies', qwarc.utils.SpecDependencies())

a = qwarc.QWARC(
itemClasses = qwarc.Item.__subclasses__(),
itemClasses = set(qwarc.Item.get_subclasses()),
warcBasePath = args.warc,
dbPath = args.database,
command = sys.argv,


正在加载...
取消
保存