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

import autoupdate
import buildutil
import os
import web

app_id = "87efface-864d-49a5-9bb3-4b050a7c227a"
root_dir = "/usr/local/google/home/rtc/chromeos/trunk/src"
scripts_dir = "%s/scripts" % root_dir
app_dir = os.popen("pwd").read().strip()
static_dir = "%s/static" % app_dir
web.debug("Serving images from %s/static" % app_dir)

urls = ('/', 'index',
        '/update', 'update')

app = web.application(urls, globals())
render = web.template.render('templates/')


class index:
  def GET(self):
    pkgs = buildutil.GetPackages()
    return render.index(pkgs)

class update:
  """
    Processes updates from the client machine. If an update is found, the url 
    references a static link that can be served automagically from web.py.
  """
  def POST(self):
    return autoupdate.HandleUpdatePing(web.data())

if __name__ == "__main__": 
  web.debug("Setting up the static repo")
  os.system("mkdir -p %s" % static_dir)
  app.run()

<commit_msg>Fix script to correctly figure out the static directory. Review URL: http://chromereview.prom.corp.google.com/1178030<commit_after># Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import autoupdate
import buildutil
import os
import web
import sys

urls = ('/', 'index',
        '/update', 'update')

app = web.application(urls, globals())
render = web.template.render('templates/')


class index:
  def GET(self):
    pkgs = buildutil.GetPackages()
    return render.index(pkgs)

class update:
  """
    Processes updates from the client machine. If an update is found, the url 
    references a static link that can be served automagically from web.py.
  """
  def POST(self):
    return autoupdate.HandleUpdatePing(web.data())

if __name__ == "__main__":
  web.debug("Setting up the static repo")
  static_dir = os.path.realpath("%s/static" % os.path.dirname(sys.argv[0]))
  web.debug("Serving images from %s" % static_dir)
  os.system("mkdir -p %s" % static_dir)
  app.run()


{'fraction_non_alphanumeric': 0.12264995523724262, 'fraction_numerical': 0.01521933751119069, 'mean_word_length': 3.9446902654867255, 'pattern_counts': {'":': 2, '<': 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': '5121457', 'n_tokens_mistral': 757, 'n_tokens_neox': 727, 'n_words': 234}