do not package .swp files (fixes #269)
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								77df0ae324
							
						
					
				
			
			
				commit
				
					
						4cca593071
					
				
			
		
					 1 changed files with 6 additions and 0 deletions
				
			
		
							
								
								
									
										6
									
								
								setup.py
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								setup.py
									
										
									
									
									
								
							| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
from distutils.core import setup
 | 
					from distutils.core import setup
 | 
				
			||||||
import cdist
 | 
					import cdist
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
 | 
					import re
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def data_finder(data_dir):
 | 
					def data_finder(data_dir):
 | 
				
			||||||
    entries = []
 | 
					    entries = []
 | 
				
			||||||
| 
						 | 
					@ -10,6 +11,11 @@ def data_finder(data_dir):
 | 
				
			||||||
        if name == ".gitignore":
 | 
					        if name == ".gitignore":
 | 
				
			||||||
            continue
 | 
					            continue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Skip vim swp files
 | 
				
			||||||
 | 
					        swpfile = re.search(r'^\..*\.swp$', name)
 | 
				
			||||||
 | 
					        if swpfile:
 | 
				
			||||||
 | 
					            continue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        entry = os.path.join(data_dir, name)
 | 
					        entry = os.path.join(data_dir, name)
 | 
				
			||||||
        if os.path.isdir(entry):
 | 
					        if os.path.isdir(entry):
 | 
				
			||||||
            entries.extend(data_finder(entry))
 | 
					            entries.extend(data_finder(entry))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue