Just an update on my academic career, or mainly my open source endeavors.
Now I know I said this in my past blogs, You've been following right??, but I absolutely hate Python. I don't know what it is the Snek is just not compatible with me.
So WHY for the love of god did you choose to work on Python again, you ask? Well, the answer is quite simple because I am a loser work well with my friend @chris. Mainly because I like his coding style (similar to mine) and his bald head.
Anyways, this week in my open source dev class we had to pick someone else's previous 0.1 release and implement a rather easy but tricky feature to their program. We had to implement a feature that reads a text file and scans links to be ignored from a file or URL.
Alright, Cool! I've worked on Chris' code before this should be a light summer breeze. Boy little did I know that Chris wanted me to do a lot more than just implement this feature...
My guy basically wanted me to restructure his whole program to look cleaner.
Yeah... good times. But, w.e. I told him I'd do it and I am a man of my word.
He had this gigantic code block that was an eye sore.
This was the first thing I did. I made different functions that were called and outsourced a lot of the work for each type of link with a specific status code. In a sense it is not more modular (I should probably make my code as neat as his TBH! But... then again who really cares).
Once that was done, it was time to get back to the issue at hand. My initial step was to add a "-i" argument option for ignoring links from the file specified.
Super easy. I wish Java had something similar of how it handles arguments. I had to write the following to the "-i" argument option: "nargs=2, action='append' " nargs allows me to take in multiple arguments with a single option. Neat! Yet again Python proves to be superior than Java.
- Try to open file
- if file opens call regex function to search for links that do not start with a "#"
- return array if it found any links
- git remote add chris https://github.com/chrispinkney/DeadLinkage.git
- git fetch chris
- make a new branch to track the issue
No comments:
Post a Comment