mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-12-19 18:42:33 -05:00
WT-2950 invert conditionals to PEP8 preferred code style (E713)
This commit is contained in:
parent
eb227b0d4e
commit
c3a92b102f
1 changed files with 9 additions and 9 deletions
|
|
@ -225,28 +225,28 @@ class Site(doublethink.Document, ElapsedMixIn):
|
||||||
table = "sites"
|
table = "sites"
|
||||||
|
|
||||||
def populate_defaults(self):
|
def populate_defaults(self):
|
||||||
if not "status" in self:
|
if "status" not in self:
|
||||||
self.status = "ACTIVE"
|
self.status = "ACTIVE"
|
||||||
if not "claimed" in self:
|
if "claimed" not in self:
|
||||||
self.claimed = False
|
self.claimed = False
|
||||||
if not "last_disclaimed" in self:
|
if "last_disclaimed" not in self:
|
||||||
self.last_disclaimed = brozzler.EPOCH_UTC
|
self.last_disclaimed = brozzler.EPOCH_UTC
|
||||||
if not "last_claimed" in self:
|
if "last_claimed" not in self:
|
||||||
self.last_claimed = brozzler.EPOCH_UTC
|
self.last_claimed = brozzler.EPOCH_UTC
|
||||||
if not "scope" in self:
|
if "scope" not in self:
|
||||||
self.scope = {}
|
self.scope = {}
|
||||||
if "video_capture" not in self:
|
if "video_capture" not in self:
|
||||||
self.video_capture = "ENABLE_VIDEO_CAPTURE"
|
self.video_capture = "ENABLE_VIDEO_CAPTURE"
|
||||||
|
|
||||||
# backward compatibility
|
# backward compatibility
|
||||||
if "surt" in self.scope:
|
if "surt" in self.scope:
|
||||||
if not "accepts" in self.scope:
|
if "accepts" not in self.scope:
|
||||||
self.scope["accepts"] = []
|
self.scope["accepts"] = []
|
||||||
self.scope["accepts"].append({"surt": self.scope["surt"]})
|
self.scope["accepts"].append({"surt": self.scope["surt"]})
|
||||||
del self.scope["surt"]
|
del self.scope["surt"]
|
||||||
|
|
||||||
# backward compatibility
|
# backward compatibility
|
||||||
if "max_hops_off_surt" in self.scope and not "max_hops_off" in self.scope:
|
if "max_hops_off_surt" in self.scope and "max_hops_off" not in self.scope:
|
||||||
self.scope["max_hops_off"] = self.scope["max_hops_off_surt"]
|
self.scope["max_hops_off"] = self.scope["max_hops_off_surt"]
|
||||||
if "max_hops_off_surt" in self.scope:
|
if "max_hops_off_surt" in self.scope:
|
||||||
del self.scope["max_hops_off_surt"]
|
del self.scope["max_hops_off_surt"]
|
||||||
|
|
@ -256,7 +256,7 @@ class Site(doublethink.Document, ElapsedMixIn):
|
||||||
brozzler.site_surt_canon(self.seed).ssurt().decode("ascii")
|
brozzler.site_surt_canon(self.seed).ssurt().decode("ascii")
|
||||||
)
|
)
|
||||||
|
|
||||||
if not "starts_and_stops" in self:
|
if "starts_and_stops" not in self:
|
||||||
if self.get("start_time"): # backward compatibility
|
if self.get("start_time"): # backward compatibility
|
||||||
self.starts_and_stops = [
|
self.starts_and_stops = [
|
||||||
{"start": self.get("start_time"), "stop": None}
|
{"start": self.get("start_time"), "stop": None}
|
||||||
|
|
@ -271,7 +271,7 @@ class Site(doublethink.Document, ElapsedMixIn):
|
||||||
return 'Site({"id":"%s","seed":"%s",...})' % (self.id, self.seed)
|
return 'Site({"id":"%s","seed":"%s",...})' % (self.id, self.seed)
|
||||||
|
|
||||||
def _accept_ssurt_if_not_redundant(self, ssurt):
|
def _accept_ssurt_if_not_redundant(self, ssurt):
|
||||||
if not "accepts" in self.scope:
|
if "accepts" not in self.scope:
|
||||||
self.scope["accepts"] = []
|
self.scope["accepts"] = []
|
||||||
simple_rule_ssurts = (
|
simple_rule_ssurts = (
|
||||||
rule["ssurt"]
|
rule["ssurt"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue