def is_afk(self): if self.last_active_event is None: # unclear return True last_active = edtime.EDTime() last_active.from_journal_timestamp(self.last_active_event["timestamp"]) now = edtime.EDTime.py_epoch_now() return (now - last_active.as_py_epoch()) > self.inactive_threshold_seconds
def __init__(self): self.name = None self._ship = None self.location = EDLocation() self.game_mode = None self.previous_mode = None self.previous_wing = set() self.from_birth = False self._timestamp = edtime.EDTime() self.wing = set() self.friends = set()
def jump_requested(self, jump_request_event): if self.id and self.id != jump_request_event.get("CarrierID", None): self.__reset() self.id = jump_request_event.get("CarrierID", None) self.__update_position() request_time = edtime.EDTime() request_time.from_journal_timestamp(jump_request_event["timestamp"]) jump_time = request_time.as_py_epoch() + 60*15 self.departure = { "time": jump_time, "destination": jump_request_event.get("SystemName", None) }
def __init__(self): self.name = None self._ship = None self.location = EDLocation() self.game_mode = None self.previous_mode = None self.previous_wing = set() self.from_birth = False self._timestamp = edtime.EDTime() self.wing = set() self.friends = set() self.crew = None self.powerplay = None self.squadron = None self.destroyed = False self.target = None
def short_profile(self): result = u"{name}: {karma}".format(name=self.name, karma=self.karma_title()) alignment = self.crowd_alignment() if not (alignment is None or alignment == ""): result += u" {}".format(alignment) if not (self.squadron is None or self.squadron == ""): result += u", {squadron}".format(squadron=self.squadron) if not (self.role is None or self.role == ""): result += u", {role}".format(role=self.role) if not (self.powerplay is None or self.powerplay == ""): result += u", {powerplay}".format(powerplay=self.powerplay) if not (self.patreon is None or self.patreon == ""): result += u", Patreon:{patreon}".format(patreon=self.patreon) if self.dex_profile: if self.dex_profile.friend: result += _(u" [friend]") tags = self.dex_profile.tags if tags: result += u", #{}".format(" #".join(tags)) memo = self.dex_profile.memo if memo: result += u", {}".format(memo) updated_jse = self.dex_profile.updated if updated_jse: updated_edt = edtime.EDTime() updated_edt.from_js_epoch(updated_jse) result += u" ({})".format(updated_edt.as_immersive_date()) return result