-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_includes
executable file
·49 lines (37 loc) · 1.54 KB
/
gen_includes
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
#!./python
# config setup
import ignoreDeprecation
import Configuration
config = Configuration.get_Configuration ('Configuration', 1)
############################################################################
# FUNCTIONS
############################################################################
def listToFile (str_list, filename):
print ("writing %s" % filename)
fp = open (filename, 'w')
for item in str_list:
fp.write ('%s' % item)
fp.close()
return
def stringToFile (s, filename):
listToFile ( [s], filename)
return
############################################################################
# MAIN LOGIC
############################################################################
def main ():
# Includes for MGI web interfaces
stringToFile (config['WI_URL'], './include/wi_url.html')
stringToFile (config['MGIHOME_URL'], './include/mgihome_url.html')
stringToFile (config['FAQ_URL'], './include/faq_url.html')
stringToFile (config['MGI_SUPPORT'], './include/mgi_support.html')
# Includes to the other online books
stringToFile (config['COOKBOOK_URL'], './include/cookbook_url.html')
stringToFile (config['MORSEBOOK_URL'], './include/morsebook_url.html')
stringToFile (config['SILVER_URL'], './include/silverbook_url.html')
stringToFile (config['WKSILVERS_URL'], './include/wksilversbook_url.html')
# External URLs
stringToFile (config['NCBI_ABSRACT_URL'], './include/ncbi_abstract_url.html')
return
if __name__ == '__main__':
main()