Styleguide

This commit is contained in:
Reid 'arrdem' McKenzie 2021-10-13 01:07:32 -06:00
parent f276be1fbf
commit 24054b4bfc

View file

@ -2,16 +2,17 @@
import argparse import argparse
from itertools import chain from itertools import chain
import pickle
import logging import logging
import os import os
from pathlib import Path from pathlib import Path
import pickle
import sys import sys
from typing import NamedTuple from typing import NamedTuple
from toposort import toposort_flatten from toposort import toposort_flatten
from vfs import Vfs from vfs import Vfs
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
@ -149,6 +150,7 @@ def simplify(old_fs: Vfs, new_fs: Vfs) -> Vfs:
for txn in old_fs._log: for txn in old_fs._log:
if txn[0] == "link" and txn not in new_fs._log: if txn[0] == "link" and txn not in new_fs._log:
new_fs.unlink(txn[2]) new_fs.unlink(txn[2])
elif txn[0] == "mkdir" and txn not in new_fs.log: elif txn[0] == "mkdir" and txn not in new_fs.log:
new_fs.unlink(txn[1]) new_fs.unlink(txn[1])