Conditions | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
1 | #!/usr/bin/python |
||
18 | def main(): |
||
19 | url = 'https://raw.githubusercontent.com/motom001/DoorPi/master/'+metadata.daemon_name_template |
||
20 | daemon_filename = os.path.join(metadata.daemon_folder, metadata.daemon_name) |
||
21 | print("start down download and parse new daemon file:") |
||
22 | print("URL: "+url) |
||
23 | print("FILE: "+daemon_filename) |
||
24 | with open(daemon_filename, "w") as daemon_file: |
||
25 | for line in urllib2.urlopen(url): |
||
26 | daemon_file.write(parse_string(line)) |
||
27 | print("download successfully - change chmod to 0755 now") |
||
28 | os.chmod(daemon_filename, 0755) |
||
29 | print "finished" |
||
30 | |||
33 |