tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

gn_logs.star (706B)


      1 # -*- bazel-starlark -*-
      2 # Copyright 2024 The Chromium Authors
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 """gn_logs module to access gn_logs data."""
      6 
      7 load("@builtin//struct.star", "module")
      8 
      9 def __read(ctx):
     10     fname = ctx.fs.canonpath("./gn_logs.txt")
     11     if not ctx.fs.exists(fname):
     12         return {}
     13     gn_logs = ctx.fs.read(fname)
     14     vars = {}
     15     for line in str(gn_logs).splitlines():
     16         if line.startswith("#"):
     17             continue
     18         if not "=" in line:
     19             continue
     20         kv = line.split("=", 1)
     21         vars[kv[0].strip()] = kv[1].strip()
     22     return vars
     23 
     24 gn_logs = module(
     25     "gn_logs",
     26     read = __read,
     27 )