Skip to content

Commit

Permalink
preprocess - always flush to console
Browse files Browse the repository at this point in the history
  • Loading branch information
slatinsky committed Aug 29, 2023
1 parent b46c1ba commit e6db0d0
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 2 deletions.
2 changes: 2 additions & 0 deletions backend/preprocess/AssetProcessor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

import functools
import os
import re
from colorthief import ColorThief
Expand All @@ -8,6 +9,7 @@
from FileFinder import FileFinder
from MongoDatabase import MongoDatabase

print = functools.partial(print, flush=True)

class AssetProcessor:
def __init__(self, file_finder: FileFinder, database: MongoDatabase):
Expand Down
2 changes: 2 additions & 0 deletions backend/preprocess/ChannelCache.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

import functools
import os

from MongoDatabase import MongoDatabase
from helpers import is_compiled

print = functools.partial(print, flush=True)

class ChannelCache:
"""
Expand Down
4 changes: 4 additions & 0 deletions backend/preprocess/Downloader.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@



import functools
import os

import requests

print = functools.partial(print, flush=True)



def download_gg(output_directory):
"""
Expand Down
5 changes: 4 additions & 1 deletion backend/preprocess/FileFinder.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import functools
import glob
import re
import os
import traceback

print = functools.partial(print, flush=True)


class FileFinder():
"""
Expand Down
3 changes: 3 additions & 0 deletions backend/preprocess/JsonFileStreamer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import functools
import ijson
import datetime

print = functools.partial(print, flush=True)


class JsonFileStreamer():
def __init__(self, json_path: str):
Expand Down
3 changes: 2 additions & 1 deletion backend/preprocess/JsonProcessor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@


import copy
import functools
import hashlib
from itertools import zip_longest
import os
Expand All @@ -16,7 +17,7 @@
from JsonFileStreamer import JsonFileStreamer
from helpers import find_additional_missing_numbers, get_emoji_code, pad_id, batched


print = functools.partial(print, flush=True)


class JsonProcessor:
Expand Down
4 changes: 4 additions & 0 deletions backend/preprocess/MongoDatabase.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

import functools
from pymongo import MongoClient

print = functools.partial(print, flush=True)


class MongoDatabase():
"""
Connects to the MongoDB database
Expand Down
2 changes: 2 additions & 0 deletions backend/preprocess/Timer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import functools
import time

print = functools.partial(print, flush=True)

class Timer(object):
def __init__(self, name=None):
Expand Down
4 changes: 4 additions & 0 deletions backend/preprocess/helpers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import functools
from itertools import islice
import json
import os

print = functools.partial(print, flush=True)



with open('emojiIndex.json', 'r', encoding='utf8') as f:
emoji_index = json.load(f)
Expand Down

0 comments on commit e6db0d0

Please sign in to comment.