diff options
| author | Donald Delmar Davis <ddavis3@jaguarlandrover.com> | 2014-12-12 00:44:35 +0000 |
|---|---|---|
| committer | Donald Delmar Davis <ddavis3@jaguarlandrover.com> | 2014-12-12 00:44:35 +0000 |
| commit | caa1a4f3d6f365408dfeee37e7844e1dee60a2c7 (patch) | |
| tree | a13253983b71e0649a8564d7193a814b9ba4113a | |
| parent | 94f8c3f145d592bf1be3102599ee6d8113b562ec (diff) | |
rudimentrey system checks
| -rwxr-xr-x | loader.py | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -28,8 +28,27 @@ def read_stderr_realtime(proc, stream='stderr'): out = ''.join(out) yield out +def check_environment(d): + d.set_background_title("Checking your environment") + if subprocess.check_call(["ping", "8.8.8.8", "-c1", "-W5"]) != 0: + d.set_background_title("Fatal: Not Connected To Network") + d.msgbox("Please check your network connection and restart") + sys.exit(1) + if subprocess.check_call(["ping", "192.168.4.200", "-c1", "-W5"]) != 0: + d.set_background_title("Fatal: Can not find depot") + d.msgbox("Please check your network connection and restart") + sys.exit(1) + if subprocess.check_call(["mount","depot:/home/public/images","/mnt/images"]) !=0: + d.set_background_title("Fatal: Can not mount images directory") + d.msgbox("Please contact your system administrator") + sys.exit(1) + d = Dialog(dialog="dialog") + +check_environment(d) + d.set_background_title("Select file to load.....") + code, selection = d.fselect('/mnt/images/',10,70) if code == d.OK : |
