Esempio n. 1
0
 def convert(self):
     """Converts all wakaba post tables to chieftain WakabaPost table."""
     print "Initializing wakaba bans"
     for i in self.get_bans():
         WakabaBan(**i).save()
     for i, p in enumerate(self.get_posts()):
         self.convert_post(p)
         print_flush("Initialized post {}".format(i))
     print "\nInitialized {} posts. Trying to convert them...".format(i)
Esempio n. 2
0
 def convert(self):
     """Converts all wakaba post tables to chieftain WakabaPost table."""
     print "Initializing wakaba bans"
     for i in self.get_bans():
         WakabaBan(**i).save()
     for i, p in enumerate(self.get_posts()):
         self.convert_post(p)
         print_flush("Initialized post {}".format(i))
     print "\nInitialized {} posts. Trying to convert them...".format(i)
Esempio n. 3
0
 def convert_posts(self, start=0, first_post=False):
     filter_args = {"parent": 0} if first_post else {"parent__gt": 0}
     posts = WakabaPost.objects.filter(**filter_args).order_by("id")[start:]
     for i, p in enumerate(posts):
         i += start
         if first_post:
             i = "f{}".format(i)
         print_flush("Converting post {}".format(i))
         try:
             self.convert_post(p, first_post)
         except ConvertError as e:
             print "\nFailed to convert post {}: {}".format(i, e)
     print "\n"
Esempio n. 4
0
 def convert_posts(self, start=0, first_post=False):
     filter_args = {"parent": 0} if first_post else {"parent__gt": 0}
     posts = WakabaPost.objects.filter(**filter_args).order_by("id")[start:]
     for i, p in enumerate(posts):
         i += start
         if first_post:
             i = "f{}".format(i)
         print_flush("Converting post {}".format(i))
         try:
             self.convert_post(p, first_post)
         except ConvertError as e:
             print "\nFailed to convert post {}: {}".format(i, e)
     print "\n"