<commit_before># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""Bootstraps a swarming bot to connect host_url.

See swarming/swarm_bot/bootstrap.py for more details.
"""

# host_url = 'http://foo' is added at the top of this file.
# pylint: disable=E0602

import os
import shutil
import sys
import urllib

if sys.platform in ('cygwin', 'win32'):
  root = '/cygdrive/e/b/swarm_slave'
else:
  root = '/b/swarm_slave'
if os.path.isdir(root):
  print('Warning: deleting %s' % root)
  shutil.rmtree(root, ignore_errors=True)
if not os.path.isdir(root):
  os.makedirs(root)
zip_file = os.path.join(root, 'swarming_bot.zip')
urllib.urlretrieve('%s/get_slave_code' % host_url, zip_file)
os.execv(sys.executable, [sys.executable, zip_file])<commit_msg>Ensure that swarming bootstrap always uses E drive even if called from cmd prompt.<commit_after># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""Bootstraps a swarming bot to connect host_url.

See swarming/swarm_bot/bootstrap.py for more details.
"""

# host_url = 'http://foo' is added at the top of this file.
# pylint: disable=E0602

import os
import shutil
import sys
import urllib

if sys.platform == 'cygwin':
  root = '/cygdrive/e/b/swarm_slave'
elif sys.platform == 'win32':
  root = 'e:\\b\\swarm_slave'
else:
  root = '/b/swarm_slave'
if os.path.isdir(root):
  print('Warning: deleting %s' % root)
  shutil.rmtree(root, ignore_errors=True)
if not os.path.isdir(root):
  os.makedirs(root)
zip_file = os.path.join(root, 'swarming_bot.zip')
urllib.urlretrieve('%s/get_slave_code' % host_url, zip_file)
os.execv(sys.executable, [sys.executable, zip_file])
{'fraction_non_alphanumeric': 0.12187159956474429, 'fraction_numerical': 0.01088139281828074, 'mean_word_length': 4.641104294478527, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3619602', 'n_tokens_mistral': 683, 'n_tokens_neox': 655, 'n_words': 197}