mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	merge
This commit is contained in:
		
						commit
						9e66ac683c
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		| 
						 | 
					@ -7,15 +7,19 @@ syntax of make rules.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
In addition to the dependency syntax, #-comments are supported.
 | 
					In addition to the dependency syntax, #-comments are supported.
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					import errno
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def parse_config(repo):
 | 
					def parse_config(repo):
 | 
				
			||||||
    configfile = repo.wjoin(".hgtouch")
 | 
					    try:
 | 
				
			||||||
    if not os.path.exists(configfile):
 | 
					        fp = repo.wfile(".hgtouch")
 | 
				
			||||||
 | 
					    except IOError, e:
 | 
				
			||||||
 | 
					        if e.errno != errno.ENOENT:
 | 
				
			||||||
 | 
					            raise
 | 
				
			||||||
        return {}
 | 
					        return {}
 | 
				
			||||||
    result = {}
 | 
					    result = {}
 | 
				
			||||||
    with open(configfile) as f:
 | 
					    with fp:
 | 
				
			||||||
        for line in f:
 | 
					        for line in fp:
 | 
				
			||||||
            # strip comments
 | 
					            # strip comments
 | 
				
			||||||
            line = line.split('#')[0].strip()
 | 
					            line = line.split('#')[0].strip()
 | 
				
			||||||
            if ':' not in line:
 | 
					            if ':' not in line:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue