minor formatting
parent
6a1b056ed9
commit
42c7364589
|
@ -1,3 +1,7 @@
|
|||
__pycache__/
|
||||
seed
|
||||
out/
|
||||
out/
|
||||
build/
|
||||
dist/
|
||||
*.egg-info/
|
||||
.vscode
|
|
@ -13,12 +13,14 @@ now = '{0:%Y%m%dT%H%M%S}'.format(datetime.utcnow())
|
|||
|
||||
Base = declarative_base()
|
||||
|
||||
|
||||
def db_config(path: Path) -> Session:
|
||||
engine = create_engine(f'sqlite:///{path.resolve()}', native_datetime=True)
|
||||
Base.metadata.create_all(engine)
|
||||
session = Session(engine)
|
||||
return session
|
||||
|
||||
|
||||
class ScrapNode(Base):
|
||||
__tablename__ = 'scrap_node'
|
||||
ctime = Column(DateTime, default=datetime.utcnow)
|
||||
|
|
|
@ -70,7 +70,8 @@ def sins():
|
|||
logger.info(f'db_path: {db_path}')
|
||||
|
||||
if args.seed:
|
||||
exists = session.query(ScrapNode).filter(ScrapNode.checksum == seed.checksum)
|
||||
exists = session.query(ScrapNode).filter(
|
||||
ScrapNode.checksum == seed.checksum)
|
||||
|
||||
if exists:
|
||||
seed = exists[0]
|
||||
|
|
Loading…
Reference in New Issue