def handle(self, *args, **options): functions.show_console_log(False) title = " ".join(options["title"]) word = functions.consult(title) if word: functions.prints(word) else: print(self.style.ERROR("Consult {} failure".format(title)))
def test_console_log(self): from words import functions import logging logger = logging.getLogger('words') functions.show_console_log(show=True) logger.info("test show log in console") functions.show_console_log(show=False) logger.info("test hide log in console, but in file")
def handle(self, *args, **options): functions.show_console_log(False) items = statistics.get_date() for item in items: item = dandan.value.AttrDict(item) print("{hour:0>2} {count:>3}".format(hour=item.hour.hour, count=item.count))
def handle(self, *args, **options): functions.show_console_log(False) method = options["method"][0] if method not in self.actions: print(self.style.WARNING("No such method {}".format(method))) return if method == "help": self.man() return methods = self.actions[method] for method in methods: self.method = method() self.method.study()
def handle(self, *args, **options): functions.show_console_log(False) count = options["count"] items = statistics.get_count()[:count] items = [item for item in items] items.reverse() today = timezone.now().date() for item in items: item = dandan.value.AttrDict(item) print("{offset:0>2} {date} {count:>3} {weekday}".format( offset=(today - item.date).days, date=item.date, count=item.count, weekday=item.date.strftime("%A")))
def handle(self, *args, **options): functions.show_console_log(False) while True: self.operate()