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


Python DumpTruck.get_var方法代码示例

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


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

示例1: savegetvar

# 需要导入模块: from dumptruck import DumpTruck [as 别名]
# 或者: from dumptruck.DumpTruck import get_var [as 别名]
 def savegetvar(self, var):
   h = DumpTruck(dbname = '/tmp/test.db')
   h.save_var(u'weird', var)
   h.close()
   h = DumpTruck(dbname = '/tmp/test.db')
   t=os.stat('/tmp/test.db').st_mtime
   self.assertEqual(h.get_var(u'weird'), var)
   h.close()
   assert os.stat('/tmp/test.db').st_mtime==t
开发者ID:alixaxel,项目名称:dumptruck,代码行数:11,代码来源:tests.py

示例2: savegetvar

# 需要导入模块: from dumptruck import DumpTruck [as 别名]
# 或者: from dumptruck.DumpTruck import get_var [as 别名]
 def savegetvar(self, var):
     h = DumpTruck(dbname="/tmp/test.db")
     h.save_var(u"weird", var)
     h.close()
     h = DumpTruck(dbname="/tmp/test.db")
     t = os.stat("/tmp/test.db").st_mtime
     self.assertEqual(h.get_var(u"weird"), var)
     h.close()
     assert os.stat("/tmp/test.db").st_mtime == t
开发者ID:4bic,项目名称:entity_log,代码行数:11,代码来源:tests.py

示例3: get

# 需要导入模块: from dumptruck import DumpTruck [as 别名]
# 或者: from dumptruck.DumpTruck import get_var [as 别名]
 def get(self, key, value):
   h = DumpTruck(dbname = u'/tmp/test.db')
   self.assertEqual(h.get_var(key), value)
   h.close()
开发者ID:sungoak,项目名称:dumptruck,代码行数:6,代码来源:tests.py

示例4: savegetvar

# 需要导入模块: from dumptruck import DumpTruck [as 别名]
# 或者: from dumptruck.DumpTruck import get_var [as 别名]
 def savegetvar(self, var):
   h = DumpTruck(dbname = '/tmp/test.db')
   h.save_var(u'weird', var)
   self.assertEqual(h.get_var(u'weird'), var)
   h.close()
开发者ID:sungoak,项目名称:dumptruck,代码行数:7,代码来源:tests.py

示例5: reference

# 需要导入模块: from dumptruck import DumpTruck [as 别名]
# 或者: from dumptruck.DumpTruck import get_var [as 别名]
            kin = {"kwargs": cb.kwargs}
            kin.update(reference)
            dt.insert(kin, cb.bucket)

        # The first entry has no ancestors, so it has to make its own entry.
        if self.motherbucket == None:
            dt.insert({"scraper_run": scraper_run, "kwargs": self.kwargs}, self.bucket)
        return childbuckets

    def reference(self):
        # For linking scraped data to this row
        return {"kwargs": self.kwargs, "motherkwargs": self.motherkwargs, "scraper_run": scraper_run}


try:
    scraper_run = dt.get_var("scraper_run")
except:
    scraper_run = datetime.date.today().isoformat()
    dt.save_var("scraper_run", scraper_run)


def excavate(bucketclasses=[], startingbuckets=[]):
    "Start everything."

    # Bucket classes (page types)
    if bucketclasses == []:
        for g in globals().values():
            if isinstance(g, BucketMold) and g != BucketMold:
                bucketclasses.append(g)
    bag = Bag(buckets=bucketclasses)
开发者ID:tlevine,项目名称:wetlands,代码行数:32,代码来源:bucketwheel.py


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