Browse Source

Fix up qualifiers; working demo.

master
Ben Kurtovic 7 years ago
parent
commit
ea13819619
3 changed files with 9 additions and 3 deletions
  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 View File

@@ -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 View File

@@ -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 View File

@@ -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…
Cancel
Save