def make_output(self): Report.make_output(self) main = Section("full_companies_report", self.NAME) for company in self.data: main.add_child(company.make_output()) return main
def make_output(self): Report.make_output(self) title = "{0} - {1} a {2}".format(self.NAME, date_to_str(self.start_date), date_to_str(self.end_date)) return TableSection("most_important_companies", title, (StringData( "company", "Empresa"), CurrencyData("sales", "Vendas", unit="R$")), self.data, self.bits)
def make(self): Report.make(self) companies = [] if self.customers: companies.extend( self.db.cached_load(oks.COMPANY, type_=oks.TYPE_CUSTOMER_COMPANY, city="~%%%s%%" % self.city)) if self.suppliers: companies.extend( self.db.cached_load(oks.COMPANY, type_=oks.TYPE_SUPPLIER_COMPANY, city="~%%%s%%" % self.city)) if self.customers or self.suppliers: companies.extend( self.db.cached_load( oks.COMPANY, type_=oks.TYPE_CUSTOMER_AND_SUPPLIER_COMPANY, city="~%%%s%%" % self.city)) for company in companies: self.data.append([company.name, company.phone]) self.data.sort(key=lambda row: row[0]) # Sort by name
def make_output(self): Report.make_output(self) return TableSection( "compact_companies_report", self.NAME, (StringData("name", "Nome"), StringData("phone", "Telefone")), self.data, self.bits)
def make(self): Report.make(self) self.data = self.db.cached_load(oks.COMPANY) self.data.sort(key=lambda company: company.name)
from flask import Flask from . import templates from .utils import * import core.flags as flags import threading import requests import logging import types import sys import os import re app = Flask("Slack Events Server") seen = [] report = Report() watchlist = reload_watchlist() def initialize(): report.set_config(argsc.config) def command_ping(args): return "pong" def command_help(args): code_base_update = True if float( metadata["version"]["monitorizer"]) < float( metadata_github["version"]["monitorizer"]) else False
from . import templates from .utils import * import core.flags as flags import threading import requests import logging import types import json import sys import os import re app = Flask("Slack Events Server") seen = [] report = Report() watchlist = reload_watchlist() report.set_config(argsc.config) def command_ping(args): return "pong" def command_help(args): code_base_update = True if float( metadata["version"]["monitorizer"]) < float( metadata_github["version"]["monitorizer"]) else False toolkit_update = True if float(metadata["version"]["toolkit"]) < float( metadata_github["version"]["toolkit"]) else False
print "> Processing", sample_path # Process the sample with sandbox sandbox = Sandbox(config_file) if cpu == 'auto': filetype, platform = sandbox.identify_platform(sample_path) print "> CPU:", platform cpu = platform print "> Interpreter:", interpreter result = sandbox.execute(sample_path, cpu, '1', interpreter) # Process the sanbox result to prepare a DICT report reporter = Report(sample_path, result) print "> Generating report" # Retrive the report report = reporter.get_report() # Dump the Report in JSON format json_report = json.dumps(report, indent=4, sort_keys=True) with open(report_path, 'w') as f: f.write(json_report) print "> Report written to", report_path