generated from BrianPugh/python-template
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from BrianPugh/webrepl
WebREPL Support
- Loading branch information
Showing
15 changed files
with
609 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,3 +234,4 @@ Temporary Items | |
.apdisk | ||
|
||
/poetry.lock | ||
profile.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
# Creates and populates two set[str]: all_files, all_dirs | ||
import os, hashlib, binascii | ||
def __belay_hash_file(fn): | ||
hasher = hashlib.sha256() | ||
import os, hashlib, errno | ||
def __belay_hf(fn): | ||
h = hashlib.sha256() | ||
try: | ||
with open(fn, "rb") as f: | ||
while True: | ||
data = f.read(4096) | ||
if not data: | ||
break | ||
hasher.update(data) | ||
h.update(data) | ||
except OSError: | ||
return "0" * 64 | ||
return str(binascii.hexlify(hasher.digest())) | ||
return b"" | ||
return h.digest() | ||
def __belay_hfs(fns): | ||
print(repr([__belay_hf(fn) for fn in fns])) | ||
def __belay_mkdirs(fns): | ||
for fn in fns: | ||
try: | ||
os.mkdir('%s') | ||
except OSError as e: | ||
if e.errno != errno.EEXIST: | ||
raise | ||
all_files, all_dirs = set(), [] | ||
def enumerate_fs(path=""): | ||
def __belay_fs(path=""): | ||
for elem in os.ilistdir(path): | ||
full_name = path + "/" + elem[0] | ||
if elem[1] & 0x4000: # is_dir | ||
all_dirs.append(full_name) | ||
enumerate_fs(full_name) | ||
__belay_fs(full_name) | ||
else: | ||
all_files.add(full_name) | ||
enumerate_fs() | ||
__belay_fs() | ||
all_dirs.sort() | ||
del enumerate_fs | ||
del __belay_fs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.