-
Notifications
You must be signed in to change notification settings - Fork 60
Update to post-challenge and new challenge #181
Conversation
| chals = sub.get_new(limit=num_challenges) | ||
| _chals = sub.get_new(limit=num_challenges) | ||
| chals = sub.new(limit=num_challenges) | ||
| _chals = sub.new(limit=num_challenges) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for update to match the current PRAW API
freddiev4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @colbygk awesome work. I have some feedback for you below.
In regards to the naming scheme, see if you can run transform.py which should end up renaming directories in the proper format.
| @@ -0,0 +1,2 @@ | |||
| praw>=5.1.0 | |||
| pprint>=0.1 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for adding a requirements.txt file.
Can we move this to a etc/ folder?
post-challenges.py
Outdated
|
|
||
| logging.info("Started sending data script") | ||
| os.system("./send-data.sh") | ||
| # os.system("./send-data.sh") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just remove this line along with the log above it
|
Hi @freddiev4 I have submitted an update to transform that I think will help it do a better job. I have also backfilled the challenges to fill the gap between 313 and this current week. I just noticed that there appears to be no 334 easy challenge (in the reddit itself) |
transform.py
Outdated
| # Found a likely looking number | ||
| # tokens now possess' the remaining title | ||
| # a_token now has the original and possible multiple iteration number | ||
| # such as 166b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as a style thing, we should probably line up the first word of every line to be in the same column
# Found a likely looking number
# tokens now possess' the remaining title
# a_token now has the original and possible multiple iteration number
# such as 166b
Changed to
# Found a likely looking number
# tokens now possess' the remaining title
# a_token now has the original and possible multiple iteration number
# such as 166b
For every set of comments
|
@colbygk just had one comment in regards to style. If you fix that I think we can go ahead and merge this 🙂 great work on refactoring |
|
Okay, I think that's it. I did update the README.md that you may want to double check. |
|
Okay, fo'reals, I'm done. |
freddiev4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added one more comment + you should squash your commits 👍
| **post-challenges.py runs on Python 3.x** | ||
| ```bash | ||
| $ cd DailyProgrammerChallenges | ||
| $ mkdir tmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are we using tmp/ for here? From what you added above, it looks like we should cd into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right you are. Also added a bit about using praw.ini
|
I am unfamiliar with commit squashing. Recommendation on what to do to squash? |
|
Hm, I think I figured it out and squashed the last 5 commits into one. |
|
@colbygk here's an official guide on Rewriting History in Git. The short of it is that you can do:
From there you'll see something like: And you can change everything below the first commit to: Which will remove the commit message of every commit but the first (which is 15 commits before the most recent one, the head of your branch), and also squash everything into just one commit |
|
Looks like since I used |
|
Well, now we're down to 11 commits. :) Were you thinking that it should have more squashing? |
|
Yeah usually we can squash many commits down into 2 or 3 commits. Here I was thinking something like: |
Number two is done
The existing transform looked like it could use some improvement. This seems to work on all of the existing challenges, and also handles dealing with challenges that have unexpected numbers embedded, like a date.
|
Hmm... Okay... maybe done now? Sorry for the thrashing. |
|
Looks good to me 👍 |

I was unfamiliar with working against Reddit's APIs, so please feel full freedom to reject or request alterations to this pull request.
What I found was: