Guest User

Untitled

a guest
Apr 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. johnson@boromir:~/www/sandbox/trunklayers/tools (01:58PM)
  2. $ svn diff mergejs.py
  3. Index: mergejs.py
  4. ===================================================================
  5. --- mergejs.py (revision 7075)
  6. +++ mergejs.py (working copy)
  7. @@ -117,9 +117,9 @@
  8. """
  9. Parses the content of the named file and stores the values.
  10. """
  11. - lines = [line.strip() # Assumes end-of-line character is present
  12. + lines = [re.sub(" #.*?$", "", line).strip() # Assumes end-of-line character is present
  13. for line in open(filename)
  14. - if line.strip()] # Skip blank lines
  15. + if line.strip() and not line.strip().startswith("#")] # Skip blank lines and comments
  16.  
  17. self.forceFirst = lines[lines.index("[first]") + 1:lines.index("[last]")]
Add Comment
Please, Sign In to add comment