Seed 2019-06-03
I was focused on other stuff again today, and then I tried to write stubs for as many commands as I could think of. I then forgot to do anything resembling TDD, and put together these monstrosities with no tests whatsoever:
def cast_out_different(
left_list: typing.List[str], right_list: typing.List[str]
) -> typing.Iterable[str]:
left_set = set(left_list)
right_set = set(right_list)
left_list[:] = right_list[:] = sorted(left_set.intersection(right_set))
yield from left_set.symmetric_difference(right_set)
def compare_trees(left: str, right: str) -> typing.Iterable[str]:
for (
(left_dirpath, left_dirnames, left_filenames),
(right_dirpath, right_dirnames, right_filenames),
) in zip(os.walk(left), os.walk(right)):
yield from cast_out_different(left_dirnames, right_dirnames)
yield from cast_out_different(left_filenames, right_filenames)
for fn in left_filenames:
if not filecmp.cmp(
os.path.join(left_dirpath, fn),
os.path.join(right_dirpath, fn),
shallow=False,
):
yield fn
I'm not at all sure these work right, and I don't know if it's obvious what they're supposed to do. In any case, I'm going to try later to get things set up a little more correctly. Things to do include:
- Create a workspace for repos
- Make a poetry project seed repo
- Set up a local Python index (this is more for Dennis than Seed)
- Convert the current repo for Seed into a Seed repo that's seeded from the poetry project repo.
Misc other stuff from today:
- We're planning to go clothes shopping later on account of I shrank over the past year and a half.
- I remembered some conlanging I did (I don't remember if I ever wrote it up here), and I'm like, I really hope I did the lexicon all the way, because otherwise I'm going to have to reverse-engineer any gaps from the fact that the language sample is Genesis 11. It'd be like doing Rosetta stone style analysis of a language I created, which is to say, somehow really cool and really stupid for basically the exact same reasons.
I'd better wrap things up now so I have a chance to get on some of that tomorrow. Good night.