+ # Smart wants None here
+ if relation == "":
+ relation = None
+ if version == "":
+ version = None
I think you should use None as the default values. It will allow
you to remove the conversion code you have and shouldn't have any
impact on the behaviour of _validate_lock_condition.
+ # Smart wants () here
+ if not relation:
+ relation = ()
+ if not version:
+ version = ()
I recommend you use () as the default values for relation and
version here. It will allow you to remove the conversion code
without impacting the other surrounding code.
[4]
+ if set_package_locks:
+ message["set"] = sorted(set_package_locks)
+ if unset_package_locks:
+ message["unset"] = sorted(unset_package_locks)
Would you mind calling these keys 'lock' and 'unlock'. I realize
that's pretty nit-picky, but it feels a bit more clear to me.
[5]
+ If Smart indicates us locked packages we didn't know about, report
s/us// please.
[6]
+ Locked packages whose hashes are unkwnown don't get reported.
s/unkwnown/unknown/ please.
[7]
+ cursor.execute("CREATE TABLE package_locks"
+ " (name TEXT NOT NULL, relation TEXT, version TEXT,"
+ " UNIQUE(name, relation, version))")
+ cursor.execute("CREATE TABLE locked"
+ " (id INTEGER PRIMARY KEY)")
You need to add a patch to correctly upgrade existing package store
databases.
[1]
+ @param relation, version: The condition the package version must
+ satisfy in order to be locked.
The Epytext syntax used here is incorrect, I believe.
[2]
+ def set_package_ lock(self, name, relation="", version=""):
and then:
+ # Smart wants None here
+ if relation == "":
+ relation = None
+ if version == "":
+ version = None
I think you should use None as the default values. It will allow lock_condition.
you to remove the conversion code you have and shouldn't have any
impact on the behaviour of _validate_
[3]
+ def remove_ package_ lock(self, name, relation="", version=""):
and then:
+ # Smart wants () here
+ if not relation:
+ relation = ()
+ if not version:
+ version = ()
I recommend you use () as the default values for relation and
version here. It will allow you to remove the conversion code
without impacting the other surrounding code.
[4]
+ if set_package_locks: set_package_ locks) locks: unset_package_ locks)
+ message["set"] = sorted(
+ if unset_package_
+ message["unset"] = sorted(
Would you mind calling these keys 'lock' and 'unlock'. I realize
that's pretty nit-picky, but it feels a bit more clear to me.
[5]
+ If Smart indicates us locked packages we didn't know about, report
s/us// please.
[6]
+ Locked packages whose hashes are unkwnown don't get reported.
s/unkwnown/unknown/ please.
[7]
+ cursor. execute( "CREATE TABLE package_locks" execute( "CREATE TABLE locked"
+ " (name TEXT NOT NULL, relation TEXT, version TEXT,"
+ " UNIQUE(name, relation, version))")
+ cursor.
+ " (id INTEGER PRIMARY KEY)")
You need to add a patch to correctly upgrade existing package store
databases.