Contants.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # -*- coding:utf-8 -*-
  2. import os
  3. SDK_MAIN = "/opt/mixsdk"
  4. SDK_CONFIG = "%s/sdk_config"%SDK_MAIN
  5. SDK_LOG = "/opt/package_log"
  6. SDK_SCRIPT = "%s/script2.0"%SDK_MAIN
  7. #socket常量
  8. CONNECTFILE = '%s/cutsdk'%SDK_SCRIPT
  9. LOCKFILE = '%s/lockFile'%SDK_SCRIPT
  10. IGNORE_PACKAGE_PATH = "com/yyrh"
  11. SDK_CHANNEL_ID = "channel_id"
  12. SDK_NOTIFY_URL = "gamesdk.yyxxgame.com:9001/api/update_gcp_resource_msg/run"
  13. SDK_SP_NOTIFY_URL = "gamesdk.yyxxgame.com:9001/api/update_sp_resource_msg/run"
  14. SDK_NOTIFY_TEST_URL = "testgamesdk.yyxxgame.com/api/update_gcp_resource_msg/run"
  15. SDK_SP_NOTIFY_TEST_URL = "testgamesdk.yyxxgame.com/api/update_sp_resource_msg/run"
  16. def getSdkMain():
  17. return SDK_MAIN
  18. def getSdkConfig():
  19. return SDK_CONFIG
  20. def getSdkScript():
  21. return SDK_SCRIPT
  22. def getSdkLog():
  23. return SDK_LOG
  24. def getConnectFile():
  25. return CONNECTFILE
  26. def getLockFilePath():
  27. return LOCKFILE
  28. def getIgnorePackagePath():
  29. return IGNORE_PACKAGE_PATH
  30. def getSdkChannelid():
  31. return SDK_CHANNEL_ID
  32. def getAapt2ToolPath():
  33. return "%s/tool/Android/Sdk/build-tools/28.0.3/aapt2"%SDK_MAIN
  34. def getSdkNotifyUrl():
  35. if(getIp() == "10.255.3.8"):
  36. return SDK_NOTIFY_TEST_URL
  37. else:
  38. return SDK_NOTIFY_URL
  39. def getSdkSpNotifyUrl():
  40. if(getIp() == "10.255.3.8"):
  41. return SDK_SP_NOTIFY_TEST_URL
  42. else:
  43. return SDK_SP_NOTIFY_URL
  44. def getIp():
  45. ip = os.popen("/sbin/ifconfig | grep 'inet addr' | awk '{print $2}'").read()
  46. ip = ip[ip.find(':') + 1:ip.find('\n')]
  47. return ip
  48. def isTestEnvironment():
  49. if(getIp() == "10.255.3.8"):
  50. return True
  51. else:
  52. return False