Do not create cache folder if no-cache option
This commit is contained in:
1 parent
c3c1af113c
commit
36e7dfaa0e
3 files changed
+48
-42
No files matched your search
@@ -1,12 +1,21 @@
|
||||
from django_migration_linter.utils import split_migration_path
|
||||
|
||||
|
||||
class Migration(object):
|
||||
def __init__(self, abs_path):
|
||||
self.abs_path = abs_path
|
||||
self.app_name, self.name = split_migration_path(self.abs_path)
|
||||
|
||||
def __lt__(self, other):
|
||||
if not isinstance(other, Migration):
|
||||
return NotImplemented
|
||||
return self.abs_path < other.abs_path
|
||||
import hashlib
|
||||
|
||||
from django_migration_linter.utils import split_migration_path
|
||||
|
||||
|
||||
class Migration(object):
|
||||
def __init__(self, abs_path):
|
||||
self.abs_path = abs_path
|
||||
self.app_name, self.name = split_migration_path(self.abs_path)
|
||||
|
||||
def __lt__(self, other):
|
||||
if not isinstance(other, Migration):
|
||||
return NotImplemented
|
||||
return self.abs_path < other.abs_path
|
||||
|
||||
def get_md5hash(self):
|
||||
hash_md5 = hashlib.md5()
|
||||
with open(self.abs_path, "rb") as f:
|
||||
for chunk in iter(lambda: f.read(4096), b""):
|
||||
hash_md5.update(chunk)
|
||||
return hash_md5.hexdigest()
|
||||
Reference in new issue
Block a user