def _do_over(self):
        print("WE ARE GOING FOR IT!")

        for user_name in [user["name"] for user in User.all()]:
            User(user_name).bankrupt()

        DataScrubber.purge_duplicate_users()
        DataScrubber.purge_theme_songs()
        DataScrubber.purge_duplicates()

        # This could be so much faster
        for command_name in Command.db().all():
            command_name = command_name["name"]
            print(command_name)
            command = Command(command_name)
            command_cost = command.cost()

            if command_cost < 2:
                command.set_value("cost", 1)
            else:
                new_cost = int(command_cost / 2)
                TheFed.collect_tax(new_cost)
                command.set_value("cost", new_cost)

        return "Society now must rebuild"
Beispiel #2
0
 def __init__(
     self, user, command, args=[], allow_random_user=False, allow_random_sfx=False
 ):
     self.user = user
     self.target_command = command
     self.args = [self._sanitize(arg) for arg in args]
     self.allow_random_user = allow_random_user
     self.allow_random_sfx = allow_random_sfx
     self.all_user_names = [user["name"] for user in User.all()]
Beispiel #3
0
 def fence_sitters(cls) -> List[str]:
     return list(
         set([user["name"] for user in User.all()]) - set(cls.voters()))