-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig_reader.py
executable file
·82 lines (73 loc) · 2.25 KB
/
config_reader.py
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
"""
config_reader module
"""
import configparser as ConfigParser
import util
import os
"""
ConfigReader takes care of config file reading
"""
def get(value):
"""
:rtype: str
:param value: available options are directory, uploads, projects,
:return: string that contains value from config file.
"""
config = ConfigParser.ConfigParser()
# config.read("configFile")
config.read(os.path.join(os.path.abspath(
os.path.dirname(__file__)), 'configFile'))
return config.get('emulator', value)
TELNET_KEY = get("telnet_key")
LOCALHOST = get("localhost")
directory = get("directory")
# apk = get("apk")
# apk_unaligned = get("apk_unaligned")
# apk_test_unaligned = get("apk_test_unaligned")
adb = get("adb")
# avds = get("avds")
emulator = get("emulator")
# test_class = get("test_class")
# test_method = get("test_method")
# SERVER_FILE_ADDRESS = get("server_file_address")
# SERVER_FILE_PORT = get("server_file_port")
TEMP = get("temp")
CURRENT_DIRECTORY = get("current_directory")
# UID = get("uid")
# PROJECT_NAME = get("project_name")
EMULATOR = get("emulator")
MINIMUM_INTERVAL = int(get("minimum_interval"))
MAXIMUM_INTERVAL = int(get("maximum_interval"))
SEED = int(get("seed"))
DURATION = int(get("duration"))
# APP_PACKAGE_NAME = get("app_package_name")
UNIFORM_INTERVAL = int(get("uniform_interval"))
APK_FULL_PATH = get("apk_full_path")
AAPT = get("aapt")
EMULATOR_NAME = get("emulator_name")
EMULATOR_PORT = get("emulator_port")
LOG_ADDRESS = get("log_address")
SAMPLE_LOG = get("sample_log")
MONKEY_INTERVAL = get("monkey_interval")
MONKEY_LOG = get("monkey_log")
MOBILE_MONKEY_LOG = get("mobile_monkey_log")
DUMP_ADDRESS = get("dump_address")
HEADLESS = util.StringToBoolean((get("headless")))
MINIMUM_KEYEVENT = int(get("minimum_keyevent"))
MAXIMUM_KEYEVENT = int(get("maximum_keyevent"))
GUIDED_APPROACH = int(get("guided_approach"))
JARSIGNER = get("jarsigner")
KEY = get("key_address")
ALIAS = get("key_alias")
PASSWORD = get("key_password")
OVERRIDE_UNSIGNED = bool(int(get('override_unsigned')))
CONTEXT_FILE = bool(int(get('context_file')))
# def avd_file_reader():
# """
# returns the list of avds
# """
# txt = open(avds)
# print(txt)
# list_avds = txt.read().split('\n')
# print(list_avds)
# return list_avds