<commit_before>#!/usr/bin/env python
#-*- coding: utf-8 -*-
import urlparse
import datetime
import logging
import time
import pytz
from django.utils.timezone import make_aware
from folivora.models import Package, PackageVersion
from folivora.utils.pypi import CheeseShop, DEFAULT_SERVER


SERVER = CheeseShop(DEFAULT_SERVER)


def sync():
    print 'Query package list'
    package_names = SERVER.get_package_list()

    packages = []
    for name in package_names:
        print "Query and store %s" % name
        url = urlparse.urljoin(DEFAULT_SERVER, name)
        packages.append(Package(name=name, url=url, provider='pypi'))
    print "sync all packages to disk..."<commit_msg>Fix sync on heroku <commit_after>#!/usr/bin/env python
#-*- coding: utf-8 -*-
import urlparse
import datetime
import logging
import time
import pytz
from django.utils.timezone import make_aware
from folivora.models import Package, PackageVersion
from folivora.utils.pypi import CheeseShop, DEFAULT_SERVER


SERVER = CheeseShop(DEFAULT_SERVER)


def sync():
    print 'Query package list'
    package_names = SERVER.get_package_list()

    packages = []
    for name in package_names:
        #print "Query and store %s" % name
        url = urlparse.urljoin(DEFAULT_SERVER, name)
        packages.append(Package(name=name, url=url, provider='pypi'))
    print "sync all packages to disk..."
{'fraction_non_alphanumeric': 0.0968681718863802, 'fraction_numerical': 0.0014566642388929353, 'mean_word_length': 3.96028880866426, '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': '3772582', 'n_tokens_mistral': 416, 'n_tokens_neox': 399, 'n_words': 125}