ソースを参照

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


読み込み中…
キャンセル
保存