<commit_before>from django.core.management.base import BaseCommand
from django.conf import settings

from xanmel.db import XanmelDB
from xdf.server_db import ServerDB
from xanmel.modules.xonotic.models import *


class Command(BaseCommand):
    help = 'Pull updates server.db files to database'

    def handle(self, *args, **kwargs):
        XanmelDB(settings.XANMEL_CONFIG['settings']['db_url'])
        changed_maps = set()
        for server in XDFServer.select().where(XDFServer.server_db_path.is_null(False)):
            print('Processing server', server.name)
            sdb = ServerDB.parse_server(server)
            changed_maps = changed_maps.union(sdb.save(server))
            sdb.pull_video(server)
        print(changed_maps)
        print('Updating global pos')
        XDFTimeRecord.update_global_physics_pos(changed_maps)
        XDFTimeRecord.update_global_pos(changed_maps)
<commit_msg>Do not update global physics pos yet<commit_after>from django.core.management.base import BaseCommand
from django.conf import settings

from xanmel.db import XanmelDB
from xdf.server_db import ServerDB
from xanmel.modules.xonotic.models import *


class Command(BaseCommand):
    help = 'Pull updates server.db files to database'

    def handle(self, *args, **kwargs):
        XanmelDB(settings.XANMEL_CONFIG['settings']['db_url'])
        changed_maps = set()
        for server in XDFServer.select().where(XDFServer.server_db_path.is_null(False)):
            print('Processing server', server.name)
            sdb = ServerDB.parse_server(server)
            changed_maps = changed_maps.union(sdb.save(server))
            sdb.pull_video(server)
        print(changed_maps)
        print('Updating global pos')
        # XDFTimeRecord.update_global_physics_pos(changed_maps)
        XDFTimeRecord.update_global_pos(changed_maps)

{'fraction_non_alphanumeric': 0.09288430200977729, 'fraction_numerical': 0.0, 'mean_word_length': 3.605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3303233', 'n_tokens_mistral': 552, 'n_tokens_neox': 543, 'n_words': 112}