let python decide the TMP path
This commit is contained in:
		
							parent
							
								
									1214f8d638
								
							
						
					
					
						commit
						9acbb49937
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -25,6 +25,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
 | 
					import tempfile
 | 
				
			||||||
import logging
 | 
					import logging
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import config
 | 
					import config
 | 
				
			||||||
| 
						 | 
					@ -51,21 +52,20 @@ if os.name == 'nt':
 | 
				
			||||||
		# Documents and Settings\[User Name]\Application Data\Gajim
 | 
							# Documents and Settings\[User Name]\Application Data\Gajim
 | 
				
			||||||
		LOGPATH = os.path.join(os.environ['appdata'], 'Gajim', 'Logs') # deprecated
 | 
							LOGPATH = os.path.join(os.environ['appdata'], 'Gajim', 'Logs') # deprecated
 | 
				
			||||||
		VCARDPATH = os.path.join(os.environ['appdata'], 'Gajim', 'Vcards')
 | 
							VCARDPATH = os.path.join(os.environ['appdata'], 'Gajim', 'Vcards')
 | 
				
			||||||
		TMP = os.path.join(os.environ['tmp'], 'Gajim')
 | 
					 | 
				
			||||||
		AVATAR_PATH = os.path.join(os.environ['appdata'], 'Gajim', 'Avatars')
 | 
							AVATAR_PATH = os.path.join(os.environ['appdata'], 'Gajim', 'Avatars')
 | 
				
			||||||
	except KeyError:
 | 
						except KeyError:
 | 
				
			||||||
		# win9x, in cwd
 | 
							# win9x, in cwd
 | 
				
			||||||
		LOGPATH = 'Logs' # deprecated
 | 
							LOGPATH = 'Logs' # deprecated
 | 
				
			||||||
		VCARDPATH = 'Vcards'
 | 
							VCARDPATH = 'Vcards'
 | 
				
			||||||
		TMP = 'temporary files'
 | 
					 | 
				
			||||||
		AVATAR_PATH = 'Avatars'
 | 
							AVATAR_PATH = 'Avatars'
 | 
				
			||||||
else: # Unices
 | 
					else: # Unices
 | 
				
			||||||
	DATA_DIR = '../data'
 | 
						DATA_DIR = '../data'
 | 
				
			||||||
	LOGPATH = os.path.expanduser('~/.gajim/logs') # deprecated
 | 
						LOGPATH = os.path.expanduser('~/.gajim/logs') # deprecated
 | 
				
			||||||
	VCARDPATH = os.path.expanduser('~/.gajim/vcards')
 | 
						VCARDPATH = os.path.expanduser('~/.gajim/vcards')
 | 
				
			||||||
	TMP = '/tmp'
 | 
					 | 
				
			||||||
	AVATAR_PATH = os.path.expanduser('~/.gajim/avatars')
 | 
						AVATAR_PATH = os.path.expanduser('~/.gajim/avatars')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TMP = tempfile.gettempdir()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
try:
 | 
					try:
 | 
				
			||||||
	LOGPATH = LOGPATH.decode(sys.getfilesystemencoding())
 | 
						LOGPATH = LOGPATH.decode(sys.getfilesystemencoding())
 | 
				
			||||||
	VCARDPATH = VCARDPATH.decode(sys.getfilesystemencoding())
 | 
						VCARDPATH = VCARDPATH.decode(sys.getfilesystemencoding())
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue