# Path: sesql/config.py
# CONFIG_PATH_FALLBACK = 'sesql_config'
#     CONFIG_PATH = getattr(settings, 'SESQL_CONFIG_PATH', CONFIG_PATH_FALLBACK)
#     CONFIG_PATH = CONFIG_PATH_FALLBACK
# 
# Path: sesql/typemap.py
# class TypeMap(object):
#     def __init__(self):
#     def all_subclasses(klass, done = None):
#     def all_tables(self):
#     def all_classes(self):
#     def all_class_names(self):
#     def get_class_names_for(self, table):
#     def get_classes_for(self, table):
#     def get_table_for(self, klass):
#     def get_class_by_name(self, klass):
# 
# Path: sesql/utils.py
# def print_eta(percent, timedelta):
#     """
#     Print an ETA line, given we did percent of total in timedelta
#     """
#     if percent == 100.0 or percent == 0.0:
#         eta = 0
#     else:
#         eta = timedelta / percent * (100.0 - percent)
# 
#     print "%05.2f %% done in %s; ETA : %s" % (percent,
#                                               format_time(timedelta),
#                                               format_time(eta))


import sys
import time
from optparse import make_option
from django.db import transaction
from django.core.management.base import BaseCommand
from sesql import config
from sesql import typemap
from sesql.utils import print_eta
        start_time = time.time()
        idmin, idmax = cursor.fetchone()
        if idmin and idmax:
            print "Processing table %s from id %d to %d" % (table, idmin, idmax)
            start = idmin
            while start <= idmax:
                end = min(start + self.options['step'], idmax) + 1
                self.iteration(table, start, end)
                start = end
                time.sleep(self.options['delay'])
                timedelta = time.time() - start_time
                percent = float(start - idmin - 1) / float(idmax - idmin) * 100.0
                print_eta(percent, timedelta)
        else:
            print "Table %s is good, nothing to do" % table

    def handle(self, **options):
        """
        Really handle the command
        """
        self.options = options

        # Ensure we have a okish configuration file
        if not self.options['source'] or not self.options['target']:
            print "--source and --target are mandatory"
            sys.exit(1)

        self.source = self.options['source']
        self.target = self.options['target']


# Path: sesql/config.py
# CONFIG_PATH_FALLBACK = 'sesql_config'
#     CONFIG_PATH = getattr(settings, 'SESQL_CONFIG_PATH', CONFIG_PATH_FALLBACK)
#     CONFIG_PATH = CONFIG_PATH_FALLBACK
# 
# Path: sesql/typemap.py
# class TypeMap(object):
#     def __init__(self):
#     def all_subclasses(klass, done = None):
#     def all_tables(self):
#     def all_classes(self):
#     def all_class_names(self):
#     def get_class_names_for(self, table):
#     def get_classes_for(self, table):
#     def get_table_for(self, klass):
#     def get_class_by_name(self, klass):
# 
# Path: sesql/utils.py
# def print_eta(percent, timedelta):
#     """
#     Print an ETA line, given we did percent of total in timedelta
#     """
#     if percent == 100.0 or percent == 0.0:
#         eta = 0
#     else:
#         eta = timedelta / percent * (100.0 - percent)
# 
#     print "%05.2f %% done in %s; ETA : %s" % (percent,
#                                               format_time(timedelta),
#                                               format_time(eta))


# Path: sesql/management/commands/sesqlfixatedate.py
import sys
import time
from optparse import make_option
from django.db import transaction
from django.core.management.base import BaseCommand
from sesql import config
from sesql import typemap
from sesql.utils import print_eta

        start_time = time.time()
        idmin, idmax = cursor.fetchone()
        if idmin and idmax:
            print "Processing table %s from id %d to %d" % (table, idmin, idmax)
            start = idmin
            while start <= idmax:
                end = min(start + self.options['step'], idmax) + 1
                self.iteration(table, start, end)
                start = end
                time.sleep(self.options['delay'])
                timedelta = time.time() - start_time
                percent = float(start - idmin - 1) / float(idmax - idmin) * 100.0
                print_eta(percent, timedelta)
        else:
            print "Table %s is good, nothing to do" % table

    def handle(self, **options):
        """
        Really handle the command
        """
        self.options = options

        # Ensure we have a okish configuration file
        if not self.options['source'] or not self.options['target']:
            print "--source and --target are mandatory"
            sys.exit(1)

        self.source = self.options['source']
        self.target = self.options['target']


        for table in typemap.typemap.tables.keys():