Created
August 27, 2014 09:29
-
-
Save allanlei/33795c741018e7b2c958 to your computer and use it in GitHub Desktop.
Parse Procfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def procfile(filepath): | |
with open(filepath, 'rb') as fp: | |
for process_line in fp.readlines(): | |
process_line = process_line.strip() | |
if not process_line or process_line.startswith('#'): | |
continue | |
process_name, command = process_line.split(':', 1) | |
yield process_name.strip(), command.strip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment