Пример #1
0
 def save(self):
     if self.id == None:
         self.id = str(uuid4())
         users[self.id] = self
         userNames[self.username] = self
     usrs = [users[id].toJSON() for id in users]
     setKey("/users.json", usrs)
Пример #2
0
 def save(self):
     if self.id == None:
         self.id = str(uuid4())
         users[self.id] = self
         userNames[self.username] = self
     usrs = [users[id].toJSON() for id in users]
     setKey("/users.json", usrs)
Пример #3
0
 def save(self):
     with lock.gen_wlock():
         if self.id == None:
             self.id = str(uuid4())
             contests[self.id] = self
         setKey(f"/contests/{self.id}/contest.json", self.toJSONSimple())
     for callback in Contest.saveCallbacks:
         callback(self)
Пример #4
0
 def save(self):
     with lock.gen_wlock():
         if self.id == None:
             self.id = str(uuid4())
             messages[self.id] = self
         setKey(f"/messages/{self.id}/message.json", self.toJSONSimple())
     for callback in Message.saveCallbacks:
         callback(self)
Пример #5
0
 def save(self):
     with lock.gen_wlock():
         if self.id == None:
             self.id = str(uuid4())
             submissions[self.id] = self
         setKey(f"/submissions/{self.id}/submission.json", self.toJSONSimple())
     for callback in Submission.saveCallbacks:
         callback(self)
Пример #6
0
 def save(self):
     with lock.gen_wlock():
         if self.id == None:
             self.id = str(uuid4())
             contests[self.id] = self
         setKey(f"/contests/{self.id}/contest.json", self.toJSONSimple())
     for callback in Contest.saveCallbacks:
         callback(self)
Пример #7
0
 def save(self):
     with lock.gen_wlock():
         if self.id == None:
             self.id = str(uuid4())
             submissions[self.id] = self
         setKey(f"/submissions/{self.id}/submission.json",
                self.toJSONSimple())
     for callback in Submission.saveCallbacks:
         callback(self)
Пример #8
0
    def save(self):
        with lock.gen_wlock():
            if self.id == None:
                self.id = str(uuid4())
                problems[self.id] = self
            setKey(f"/problems/{self.id}/problem.json", self.toJSONSimple())
            for i, datum in enumerate(self.testData):
                setKey(f"/problems/{self.id}/input/in{i}.txt", datum.input)
                setKey(f"/problems/{self.id}/output/out{i}.txt", datum.output)
            self.sampleData  = [Datum.get(self.id, i) for i in range(self.samples)]

        for callback in Problem.saveCallbacks:
            callback(self)
Пример #9
0
    def save(self):
        with lock.gen_wlock():
            if self.id == None:
                self.id = str(uuid4())
                problems[self.id] = self
            setKey(f"/problems/{self.id}/problem.json", self.toJSONSimple())
            for i, datum in enumerate(self.testData):
                setKey(f"/problems/{self.id}/input/in{i}.txt", datum.input)
                setKey(f"/problems/{self.id}/output/out{i}.txt", datum.output)
            self.sampleData = [
                Datum.get(self.id, i) for i in range(self.samples)
            ]

        for callback in Problem.saveCallbacks:
            callback(self)