cc-4105. Refactored syncdb and fixed a few typos
This commit is contained in:
parent
9964c826ab
commit
3e251997f8
6 changed files with 53 additions and 28 deletions
|
@ -1,12 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# testing ground for the script
|
||||
import pyinotify
|
||||
import time
|
||||
from media.monitor.listeners import OrganizeListener, StoreWatchListener
|
||||
from media.monitor.organizer import Organizer
|
||||
from media.monitor.events import PathChannel
|
||||
from media.monitor.watchersyncer import WatchSyncer
|
||||
from media.monitor.handler import ProblemFileHandler
|
||||
#from media.monitor.bootstrap import Bootstrapper
|
||||
from media.monitor.bootstrap import Bootstrapper
|
||||
from media.monitor.log import get_logger
|
||||
from media.monitor.syncdb import SyncDB
|
||||
from api_clients import api_client as apc
|
||||
|
||||
channels = {
|
||||
# note that org channel still has a 'watch' path because that is the path
|
||||
|
@ -21,6 +25,14 @@ org = Organizer(channel=channels['org'],target_path=channels['watch'].path)
|
|||
watch = WatchSyncer(channel=channels['watch'])
|
||||
problem_files = ProblemFileHandler(channel=channels['badfile'])
|
||||
|
||||
apiclient = apc.AirtimeApiClient(get_logger())
|
||||
raw_bootstrap = apiclient.get_bootstrap_info()
|
||||
print(raw_bootstrap)
|
||||
bs = Bootstrapper(db=bootstrap_db, last_run=int(time.time()), org_channels=[channels['org']], watch_channels=[channels['watch']])
|
||||
|
||||
bs.flush_organize()
|
||||
bs.flush_watch()
|
||||
|
||||
# do the bootstrapping before any listening is going one
|
||||
#conn = Connection('localhost', 'more', 'shit', 'here')
|
||||
#db = DBDumper(conn).dump_block()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue