瀏覽代碼

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…
取消
儲存