-
Notifications
You must be signed in to change notification settings - Fork 5
/
steamtrades_settings.py
101 lines (72 loc) · 2.46 KB
/
steamtrades_settings.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import os
path = os.path.dirname(__file__)
try:
os.makedirs(path+'output')
os.makedirs(path+'data')
except OSError,e:
pass
def chk_min(no):
if no >= 3900:
return True
else:
return False
def chk_value(no1,no2):
if no2 > no1:
return True
else:
return False
def enter_sleep_time():
input_time = raw_input('\nEnter the sleep time range(Default is 3900-4200)\nPress ENTER for default\n')
if input_time is '':
f = open(path+'data/sleep_time.txt', 'w')
time_range = '3900-4200'
f.write(time_range)
print('\nDefault time 65-70 min set\n')
else:
try:
time1,time2 = input_time.split('-')
time1 = int(time1)
time2 = int(time2)
if chk_value(time1,time2) and chk_min(time1) is True:
f = open(path+'data/sleep_time.txt', 'w')
f.write(input_time)
print "\nNew sleep time range is %s\n"%input_time
else:
print "\nERROR: Wrong input (start range cannot be less than 2100)\n"
enter_sleep_time()
except ValueError, e:
print '\nError: Wrong Input\n'
enter_sleep_time()
def enter_cookies():
cookie = raw_input('\nEnter the cookie\n')
f = open(path+'data/cookie_steam_trades.txt', 'w')
f.write(cookie)
f.close()
print ('\n cookies %s Successfully entered\n'%cookie)
def enter_url():
url = raw_input('\nEnter the url\n')
f = open(path+'data/links_steam_trades.txt', 'a')
f.write(url+'\n')
f.close()
print ('\n Url %s Successfully entered\n'%url)
print '\n####################################################################\n'
print '\nThis script is for setting the configuration adding url & cookies\n'
message = "1.Enter URL\n2.Enter cookie\n3.Enter sleep time\n4.Exit\n\n"
while True:
print message
try:
no = raw_input()
if no is '1':
enter_url()
elif no is '2':
enter_cookies()
elif no is '3':
print '\nThis setting is for sleep time range'
print '\neg if range in 3900-4200(dafault) program will stop for any time between 3900-4200'
enter_sleep_time()
elif no is '4':
exit()
else:
print'\n Wrong input \n'
except NameError, e:
exit()