wimglenn / advent-of-code-data

Get your Advent of Code data with a single import statement
MIT License
510 stars 55 forks source link

Filenames don't seem to be extracted properly #3

Closed ioistired closed 6 years ago

ioistired commented 6 years ago

For the life of me I can't get this working.

Here's what I've tried:

from aocd import data

print(data)

Directory for all examples is ~/code/by-language/python/3/adventofcode/2017/13. With a directory like that, you'd think any filename would work, right? Wrong. Here are the filenames I've tried.

All print None. What should I do?

ioistired commented 6 years ago

Since [n] = re.findall(pattern_day, filename) only allows one number in the directory, I tried ~/code/by-language/python/adventofcode/2017/13 and that didn't work either.

wimglenn commented 6 years ago

@bmintz If there are no digits in the filename, that frame will be skipped. This rules out test.py and firewall.py. Most of the other examples in your post should work in release v0.4.2, I've tweaked the logic a little to allow your directory structure (multiple numbers are now ok, as long as they are the same number - so best to keep the /3/ segment out of the path).

Please pip install --upgrade advent-of-code-data and try again.

ioistired commented 6 years ago

I made it so that only the last number is kept