Add Android (with QPython3) support
This commit is contained in:
parent
92a3e4c350
commit
317d575a90
|
@ -5,7 +5,7 @@
|
||||||
# ip2e (IP to email) - Create the configuration file. |
|
# ip2e (IP to email) - Create the configuration file. |
|
||||||
# Created by clamsawd (clamsawd@openmailbox.org) |
|
# Created by clamsawd (clamsawd@openmailbox.org) |
|
||||||
# Licensed by GPL v.3 |
|
# Licensed by GPL v.3 |
|
||||||
# Last update: 01-12-2015 |
|
# Last update: 16-02-2016 |
|
||||||
# |
|
# |
|
||||||
# Compatible with Python 3.x |
|
# Compatible with Python 3.x |
|
||||||
# --------------------------------------------------------------
|
# --------------------------------------------------------------
|
||||||
|
@ -34,9 +34,13 @@ def ClearScreen():
|
||||||
print ("Error: Unable clear screen")
|
print ("Error: Unable clear screen")
|
||||||
|
|
||||||
#Detect system & PATH of user folder
|
#Detect system & PATH of user folder
|
||||||
if os.name == "posix":
|
if os.path.exists("/storage/sdcard0"):
|
||||||
|
HOMESCARD0="/storage/sdcard0/Android/data"
|
||||||
|
os.chdir(HOMESCARD0)
|
||||||
|
print ("Android (Posix) detected")
|
||||||
|
elif os.name == "posix":
|
||||||
os.chdir(os.environ["HOME"])
|
os.chdir(os.environ["HOME"])
|
||||||
print ("POSIX detected")
|
print ("Unix (Posix) detected")
|
||||||
elif os.name == "nt":
|
elif os.name == "nt":
|
||||||
os.chdir(os.environ["USERPROFILE"])
|
os.chdir(os.environ["USERPROFILE"])
|
||||||
print ("Windows detected")
|
print ("Windows detected")
|
||||||
|
|
|
@ -39,11 +39,17 @@ def ClearScreen():
|
||||||
print ("Error: Unable clear screen")
|
print ("Error: Unable clear screen")
|
||||||
|
|
||||||
#Detect system & PATH of user folder
|
#Detect system & PATH of user folder
|
||||||
if os.name == "posix":
|
if os.path.exists("/storage/sdcard0"):
|
||||||
|
HOMESCARD0="/storage/sdcard0/Android/data"
|
||||||
|
os.chdir(HOMESCARD0)
|
||||||
|
LogFile=HOMESCARD0+"/ip2e/ip2e.log"
|
||||||
|
LockFile=HOMESCARD0+"/ip2e/ip2e.lock"
|
||||||
|
print ("Android (Posix) detected")
|
||||||
|
elif os.name == "posix":
|
||||||
os.chdir(os.environ["HOME"])
|
os.chdir(os.environ["HOME"])
|
||||||
LogFile=os.environ["HOME"]+"/.ip2e/ip2e.log"
|
LogFile=os.environ["HOME"]+"/.ip2e/ip2e.log"
|
||||||
LockFile=os.environ["HOME"]+"/.ip2e/ip2e.lock"
|
LockFile=os.environ["HOME"]+"/.ip2e/ip2e.lock"
|
||||||
print ("POSIX detected")
|
print ("Unix (Posix) detected")
|
||||||
elif os.name == "nt":
|
elif os.name == "nt":
|
||||||
os.chdir(os.environ["USERPROFILE"])
|
os.chdir(os.environ["USERPROFILE"])
|
||||||
LogFile=os.environ["USERPROFILE"]+"\\.ip2e\\ip2e.log"
|
LogFile=os.environ["USERPROFILE"]+"\\.ip2e\\ip2e.log"
|
||||||
|
|
10
ip2e-log.py
10
ip2e-log.py
|
@ -5,7 +5,7 @@
|
||||||
# ip2e (IP to email) - See the log file. |
|
# ip2e (IP to email) - See the log file. |
|
||||||
# Created by clamsawd (clamsawd@openmailbox.org) |
|
# Created by clamsawd (clamsawd@openmailbox.org) |
|
||||||
# Licensed by GPL v.3 |
|
# Licensed by GPL v.3 |
|
||||||
# Last update: 01-12-2015 |
|
# Last update: 16-02-2016 |
|
||||||
# |
|
# |
|
||||||
# Compatible with Python 3.x |
|
# Compatible with Python 3.x |
|
||||||
# --------------------------------------------------------------
|
# --------------------------------------------------------------
|
||||||
|
@ -34,9 +34,13 @@ def ClearScreen():
|
||||||
print ("Error: Unable clear screen")
|
print ("Error: Unable clear screen")
|
||||||
|
|
||||||
#Detect system & PATH of user folder
|
#Detect system & PATH of user folder
|
||||||
if os.name == "posix":
|
if os.path.exists("/storage/sdcard0"):
|
||||||
|
HOMESCARD0="/storage/sdcard0/Android/data"
|
||||||
|
os.chdir(HOMESCARD0)
|
||||||
|
print ("Android (Posix) detected")
|
||||||
|
elif os.name == "posix":
|
||||||
os.chdir(os.environ["HOME"])
|
os.chdir(os.environ["HOME"])
|
||||||
print ("POSIX detected")
|
print ("Unix (Posix) detected")
|
||||||
elif os.name == "nt":
|
elif os.name == "nt":
|
||||||
os.chdir(os.environ["USERPROFILE"])
|
os.chdir(os.environ["USERPROFILE"])
|
||||||
print ("Windows detected")
|
print ("Windows detected")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user