From 057b1b29785861dc5764eeb0ae0a3c82aca85ec7 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Wed, 3 May 2023 21:49:55 -0300 Subject: [PATCH] Add credits --- modules/callbacks.py | 2 ++ modules/logging_colors.py | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/callbacks.py b/modules/callbacks.py index a91c94a0..fb87ad56 100644 --- a/modules/callbacks.py +++ b/modules/callbacks.py @@ -51,6 +51,8 @@ class Iteratorize: """ Transforms a function that takes a callback into a lazy iterator (generator). + + Adapted from: https://stackoverflow.com/a/9969000 """ def __init__(self, func, kwargs={}, callback=None): diff --git a/modules/logging_colors.py b/modules/logging_colors.py index b4fdf1be..5485b090 100644 --- a/modules/logging_colors.py +++ b/modules/logging_colors.py @@ -1,8 +1,6 @@ -#!/usr/bin/env python -# encoding: utf-8 -import logging -# now we patch Python code to add color support to logging.StreamHandler +# Copied from https://stackoverflow.com/a/1336640 +import logging def add_coloring_to_emit_windows(fn): # add methods we need to the class