Replace $HOME in configdir with real home directory
This commit is contained in:
		@@ -11,6 +11,7 @@ Created by Marcus Stoegbauer on 2013-01-12.
 | 
				
			|||||||
Copyright (c) 2013 __MyCompanyName__. All rights reserved.
 | 
					Copyright (c) 2013 __MyCompanyName__. All rights reserved.
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
import ConfigParser
 | 
					import ConfigParser
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Conf(object):
 | 
					class Conf(object):
 | 
				
			||||||
  confobj = ConfigParser.RawConfigParser()
 | 
					  confobj = ConfigParser.RawConfigParser()
 | 
				
			||||||
@@ -33,6 +34,9 @@ class Conf(object):
 | 
				
			|||||||
      raise Exception('Cannot read config file ' + filename)
 | 
					      raise Exception('Cannot read config file ' + filename)
 | 
				
			||||||
    # if cannot read
 | 
					    # if cannot read
 | 
				
			||||||
    self.cfgfile = filename
 | 
					    self.cfgfile = filename
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    configdir=self.get("Main","configdir").replace("$HOME",os.environ['HOME'])
 | 
				
			||||||
 | 
					    self.confobj.set("Main","configdir",configdir)
 | 
				
			||||||
  # def setfilename
 | 
					  # def setfilename
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def get(self, section, option):
 | 
					  def get(self, section, option):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user