mirror of
https://github.com/twisterarmy/twister-data-guard.git
synced 2025-01-12 07:57:55 +00:00
add unlock.py
This commit is contained in:
parent
0e4a383967
commit
a7b0277a31
26
scripts/unlock.py
Normal file
26
scripts/unlock.py
Normal file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Auto-following/reading bot written in Python 2 has a mission to safe distributed data shared in the twister network
|
||||
# (https://github.com/twisterarmy/twister-data-guard)
|
||||
# This script based on the official usernameCrawler
|
||||
# (https://github.com/miguelfreitas/twister-core/blob/master/contrib/usernameCrawler.py)
|
||||
#
|
||||
# Downloaded data is cached in a python pickle file, so it may be executed
|
||||
# again and it won't need to get everything all over again (you may run it
|
||||
# from cron scripts, for example)
|
||||
|
||||
import sys, cPickle
|
||||
|
||||
dbFileName = "twisterDataGuard.pickle" # service database file
|
||||
|
||||
class MyDb:
|
||||
lastBlockHash = 0
|
||||
dataLock = False
|
||||
|
||||
try:
|
||||
db = cPickle.load(open(dbFileName))
|
||||
db.dataLock = False
|
||||
cPickle.dump(db, open(dbFileName, "w"))
|
||||
print "indexing uclocked."
|
||||
except:
|
||||
print "database not created yet."
|
Loading…
Reference in New Issue
Block a user