Преглед изворни кода

Fix up qualifiers; working demo.

master
Ben Kurtovic пре 8 година
родитељ
комит
ea13819619
3 измењених фајлова са 9 додато и 3 уклоњено
  1. +1
    -1
      calefaction/modules/campaigns/update.py
  2. +4
    -2
      config/modules/campaigns.yml.sample
  3. +4
    -0
      scripts/import_sde.py

+ 1
- 1
calefaction/modules/campaigns/update.py Прегледај датотеку

@@ -25,7 +25,7 @@ def _build_filter(qualifiers):
contents of a config file because it originates from a known place on the
filesystem.
"""
namespace = {}
namespace = {"g": g}
body = "def _func(kill):\n" + textwrap.indent(qualifiers, " " * 4)
exec(body, namespace)
return namespace["_func"]


+ 4
- 2
config/modules/campaigns.yml.sample Прегледај датотеку

@@ -35,8 +35,10 @@ campaigns:
isk: true
# Python function to filter kills:
qualifiers: |-
return (kill["victim"]["corporationName"] == "Foo Corporation" and
kill["victim"]["shipTypeID"] in ...)
victim = kill["victim"]
corpname = victim["corporationName"]
killed = g.eve.universe.killable(victim["shipTypeID"])
return corpname == "Foo Corporation" and killed.group == "Frigate"
# Will track possession of Tritanium by all corp members:
titan:
title: Let's Build a Titan


+ 4
- 0
scripts/import_sde.py Прегледај датотеку

@@ -1,6 +1,10 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Import an EVE Online Static Data Export dump to Calefaction.
"""

import gzip
from pathlib import Path
import shutil


Loading…
Откажи
Сачувај