summarylogtreecommitdiffstats
path: root/airnef-linux.patch
blob: 9321b9fe8d59567ef910d2c85fb202c1713d092e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff -uNrb airnef/airnefcmd.py airnef.new/airnefcmd.py
--- airnef/airnefcmd.py	2015-10-07 13:49:44.000000000 +0200
+++ airnef.new/airnefcmd.py	2019-01-28 22:43:14.207678865 +0100
@@ -134,6 +134,7 @@
 	
 		self.isWin32 = None								# True if we're running on a Windows platform
 		self.isOSX = None								# True if we're runnong on an OSX platform
+		self.isLinux = None								# True if we're runnong on an Linux platform
 		self.isFrozen = None							# True if we're running in a pyintaller frozen environment (ie, built as an executable)		
 		self.args = None								# dictionary of command-line arguments (generated by argparse)
 		self.appDir = None								# directory where script is located. this path is used to store all metadata files, in case script is run in different working directory
@@ -431,6 +432,7 @@
 
 	g.isWin32 = (platform.system() == 'Windows')
 	g.isOSX = (platform.system() == 'Darwin') 
+	g.isLinux = (platform.system() == 'Linux')
 	g.isFrozen = (getattr(sys, 'frozen', False)) # note for OSX isFrozen is always false because py2app only marks airnef.pyw as frozen when we're a py2app
 
 	#
@@ -454,6 +456,10 @@
 			applicationSupportDir = os.path.join(userHomeDir, 'Library/Application Support')
 			if os.path.exists(applicationSupportDir): # probably not necessary to check existence since every system should have this directory
 				g.appDataDir = os.path.join(applicationSupportDir, 'airnef/appdata')
+	elif g.isLinux: # for OSX we always try to store our app data under Application Support
+		userHomeDir = os.getenv('HOME')
+		if userHomeDir:
+			g.appDataDir = os.path.join(userHomeDir, '.local/share/airnef')
 	if not g.appDataDir:
 		# none of runtime-specific cases above selected an app data directory - use directory based off our app directory
 		g.appDataDir = os.path.join(g.appDir, "appdata")
diff -uNrb airnef/airnef.pyw airnef.new/airnef.pyw
--- airnef/airnef.pyw	2015-10-08 09:57:00.000000000 +0200
+++ airnef.new/airnef.pyw	2019-01-28 22:43:14.211012198 +0100
@@ -104,6 +104,7 @@
 	def __init__(self):
 		self.isWin32 = None			# True if we're running on a Windows platform
 		self.isOSX = None			# True if we're runnong on an OSX platform
+		self.isLinux = None			# True if we're runnong on an Linux platform
 		self.isFrozen = None		# True if we're running in a pyintaller frozen environment (ie, built as an executable)
 		self.appDir = None			# directory where script is located. this path is used to store all metadata files, in case script is run in different working directory
 		self.appDataDir = None		# directory where we keep app metadata
@@ -1202,6 +1203,7 @@
 
 	g.isWin32 = (platform.system() == 'Windows')
 	g.isOSX = (platform.system() == 'Darwin')
+	g.isLinux = (platform.system() == 'Linux')
 	g.isFrozen = (getattr(sys, 'frozen', False))
 
 	#
@@ -1226,6 +1228,10 @@
 			applicationSupportDir = os.path.join(userHomeDir, 'Library/Application Support')
 			if os.path.exists(applicationSupportDir): # probably not necessary to check existence since every system should have this directory
 				g.appDataDir = os.path.join(applicationSupportDir, 'airnef/appdata')
+	elif g.isLinux: # for Linux we use .local/share for that
+		userHomeDir = os.getenv('HOME')
+		if userHomeDir:
+			g.appDataDir = os.path.join(userHomeDir, '.local/share/airnef')
 	if not g.appDataDir:
 		# none of runtime-specific cases above selected an app data directory - use directory based off our app directory
 		g.appDataDir = os.path.join(g.appDir, "appdata")