Skip to content

Commit

Permalink
Removed unused settings.DENO_ROLLUP_MATCH_PATH. Separate SourceFile.h…
Browse files Browse the repository at this point in the history
…as_rollup_hint().
  • Loading branch information
Dmitri-Sintsov committed Mar 23, 2022
1 parent a39486d commit 668f141
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
1 change: 0 additions & 1 deletion django_deno/conf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
DENO_RELOAD = getattr(settings, 'DENO_RELOAD', False)
DENO_CHECK_LOCK_FILE = getattr(settings, 'DENO_CHECK_LOCK_FILE', False)
DENO_USE_VENDOR = getattr(settings, 'DENO_USE_VENDOR', True)
DENO_ROLLUP_MATCH_PATH = getattr(settings, 'DENO_ROLLUP_MATCH_PATH', True)

DENO_INSTALL = getattr(settings, 'DENO_INSTALL', os.getenv('DENO_INSTALL'))
if DENO_INSTALL is None:
Expand Down
22 changes: 13 additions & 9 deletions django_deno/sourcefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,18 @@ def get_mmap(self):
if fd is not None:
os.close(fd)

def should_rollup(self, short_path=None):
if settings.DENO_ENABLE and self.stat.st_size > 0:
with self.get_mmap() as mfile:
if self.is_rollup_module(mfile):
for hint in self.rollup_hints:
if mfile[:len(hint)] == hint:
return True
if settings.DENO_ROLLUP_MATCH_PATH:
if short_path in settings.DENO_ROLLUP_ENTRY_POINTS:
def has_rollup_hint(self):
with self.get_mmap() as mfile:
if self.is_rollup_module(mfile):
for hint in self.rollup_hints:
if mfile[:len(hint)] == hint:
return True
return False

def should_rollup(self, short_path):
if settings.DENO_ENABLE:
if short_path in settings.DENO_ROLLUP_ENTRY_POINTS:
return True
if self.stat.st_size > 0:
return self.has_rollup_hint()
return False

0 comments on commit 668f141

Please sign in to comment.