OLD | NEW |
1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
4 | 4 |
5 import BaseHTTPServer | 5 import BaseHTTPServer |
6 import json | 6 import json |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import SocketServer | 9 import SocketServer |
10 import sys | 10 import sys |
11 import threading | 11 import threading |
12 | 12 |
13 BOT_DIR = os.path.dirname(os.path.abspath(__file__)) | 13 BOT_DIR = os.path.dirname(os.path.abspath(__file__)) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 def _run(self): | 118 def _run(self): |
119 self._httpd.serve_forever() | 119 self._httpd.serve_forever() |
120 | 120 |
121 | 121 |
122 def gen_zip(url): | 122 def gen_zip(url): |
123 """Returns swarming_bot.zip content.""" | 123 """Returns swarming_bot.zip content.""" |
124 with open(os.path.join(BOT_DIR, 'config', 'bot_config.py'), 'rb') as f: | 124 with open(os.path.join(BOT_DIR, 'config', 'bot_config.py'), 'rb') as f: |
125 bot_config_content = f.read() | 125 bot_config_content = f.read() |
126 return bot_archive.get_swarming_bot_zip( | 126 return bot_archive.get_swarming_bot_zip( |
127 BOT_DIR, url, '1', {'config/bot_config.py': bot_config_content}) | 127 BOT_DIR, url, '1', {'config/bot_config.py': bot_config_content}) |
OLD | NEW |