<commit_before># Easy paver commands for less command typing and more coding.
# Visit http://paver.github.com/paver/ to get started. - @brandondean Sept. 30
from paver.easy import *

path = path("./")

@task
def clean():
  """Get rid of junk files."""

  if path.files("bulkloader-*"):
    sh("rm bulkloader-*")
    print("All cleaned up!")
  else:
    print("Nothing to clean! :)")

@task
def setup():
  """Set up data for development environments."""
  
  print("Setting up dev data.")
  
  print("Getting Teams")
  sh("curl -s http://localhost:8088/tasks/get/fms_team_list")
  print("Importing test Event data")
  sh("echo \"omgrobots\" | appcfg.py upload_data --config_file=bulkloader.yaml --filename=test_data/events.csv --kind=Event --url=http://localhost:8088/_ah/remote_api --num_threads=1 --email=admin@localhost --passin")
  print("Importing test Match data")
  sh("echo \"omgrobots\" | appcfg.py upload_data --config_file=bulkloader.yaml --filename=test_data/matches_2010cmp.csv --kind=Match --url=http://localhost:8088/_ah/remote_api --num_threads=1 --email=admin@localhost --passin")
  print("Enqueuing building EventTeams")
  sh("curl -s http://localhost:8088/tasks/math/enqueue/eventteam_update")
  print("Getting 2010cmp videos from TBA")
  sh("curl -s http://localhost:8088/tasks/math/do/tba_videos/2010cmp")

  clean()
  print("Done setting up! 2010cmp is now ready for testing.")

@task
def test():
  """Run tests."""
  print("Running Tests")
  sh("python run_tests.py")

@task
def test_fast():
  """Run tests that don't require HTTP"""
  print("Running Fast Tests")
  sh("python run_tests.py /usr/local/google_appengine test_math_*.py")
  sh("python run_tests.py /usr/local/google_appengine test_*parser.py")
  sh("python run_tests.py /usr/local/google_appengine test_*manipulator.py")
  sh("python run_tests.py /usr/local/google_appengine test_*api.py")

@task
def less():
  """Build and Combine CSS"""
  print("Building and Combining CSS")
  sh("lessc static/css/less_css/tba_style.main.less static/css/less_css/tba_style.main.css")
  sh("lessc static/css/less_css/tba_style.gameday.less static/css/less_css/tba_style.gameday.css")
  sh("python do_compress.py css")

@task
def javascript():
    """Combine Compress Javascript"""
    print("Combining and Compressing Javascript")
    sh("python do_compress.py js")

@task
def preflight():
  """Prep a prod push"""
  test()
  less()
  javascript()
  
<commit_msg>build CSS/JS in paver setup<commit_after># Easy paver commands for less command typing and more coding.
# Visit http://paver.github.com/paver/ to get started. - @brandondean Sept. 30
from paver.easy import *

path = path("./")

@task
def clean():
  """Get rid of junk files."""

  if path.files("bulkloader-*"):
    sh("rm bulkloader-*")
    print("All cleaned up!")
  else:
    print("Nothing to clean! :)")

@task
def setup():
  """Set up data for development environments."""
  
  print("Building CSS/JS...")
  less()
  javascript()
  
  print("Setting up dev data.")
  
  print("Getting Teams")
  sh("curl -s http://localhost:8088/tasks/get/fms_team_list")
  print("Importing test Event data")
  sh("echo \"omgrobots\" | appcfg.py upload_data --config_file=bulkloader.yaml --filename=test_data/events.csv --kind=Event --url=http://localhost:8088/_ah/remote_api --num_threads=1 --email=admin@localhost --passin")
  print("Importing test Match data")
  sh("echo \"omgrobots\" | appcfg.py upload_data --config_file=bulkloader.yaml --filename=test_data/matches_2010cmp.csv --kind=Match --url=http://localhost:8088/_ah/remote_api --num_threads=1 --email=<EMAIL>@localhost --passin")
  print("Enqueuing building EventTeams")
  sh("curl -s http://localhost:8088/tasks/math/enqueue/eventteam_update")
  print("Getting 2010cmp videos from TBA")
  sh("curl -s http://localhost:8088/tasks/math/do/tba_videos/2010cmp")

  clean()
  print("Done setting up! 2010cmp is now ready for testing.")

@task
def test():
  """Run tests."""
  print("Running Tests")
  sh("python run_tests.py")

@task
def test_fast():
  """Run tests that don't require HTTP"""
  print("Running Fast Tests")
  sh("python run_tests.py /usr/local/google_appengine test_math_*.py")
  sh("python run_tests.py /usr/local/google_appengine test_*parser.py")
  sh("python run_tests.py /usr/local/google_appengine test_*manipulator.py")
  sh("python run_tests.py /usr/local/google_appengine test_*api.py")

@task
def less():
  """Build and Combine CSS"""
  print("Building and Combining CSS")
  sh("lessc static/css/less_css/tba_style.main.less static/css/less_css/tba_style.main.css")
  sh("lessc static/css/less_css/tba_style.gameday.less static/css/less_css/tba_style.gameday.css")
  sh("python do_compress.py css")

@task
def javascript():
    """Combine Compress Javascript"""
    print("Combining and Compressing Javascript")
    sh("python do_compress.py js")

@task
def preflight():
  """Prep a prod push"""
  test()
  less()
  javascript()
  

{'fraction_non_alphanumeric': 0.15853411621785787, 'fraction_numerical': 0.01619761085239927, 'mean_word_length': 4.375408052230686, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2697896', 'n_tokens_mistral': 1767, 'n_tokens_neox': 1660, 'n_words': 398}