Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Define Instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
hengshizhi committed Jul 8, 2023
1 parent c47f090 commit d121d04
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
24 changes: 24 additions & 0 deletions mod/mods/free_other/instructs_func.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from InitialLoading import Cache
def get_other_instance(free_other_s_id):
'''Get the other object from the cache instead of creating directly'''
return Cache.GetCache(free_other_s_id).Pulling()
def Pulling(parameters):
other_instance = get_other_instance(parameters['free_other_s_id'])
return other_instance.Pulling()

def SubmitToDatabase(parameters):
other_instance = get_other_instance(parameters['free_other_s_id'])
return other_instance.SubmitToDatabase()

def AdministratorVerification(parameters):
other_instance = get_other_instance(parameters['free_other_s_id'])
return other_instance.AdministratorVerification()

def get_data(parameters):
other_instance = get_other_instance(parameters['free_other_s_id'])
return other_instance.data

def change(parameters):
other_instance = get_other_instance(parameters['free_other_s_id'])
other_instance.data = parameters['data']
return other_instance.data
2 changes: 1 addition & 1 deletion mod/mods/free_other/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import uuid
import json
from InitialLoading import Cache as Cache
from sdk.instructs import run
# from sdk.instructs import run
def AtRuntimeForTheFirstTime():
pass
def main(api):
Expand Down
5 changes: 5 additions & 0 deletions sdk/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self, KEY, UseJson: bool = True, USERID=2, session='None',) -> None
'''
if (session != 'None'):
try:
self.session = session
self.id = session.data['login_status_id']
except:
self.id = None
Expand Down Expand Up @@ -54,6 +55,10 @@ def AdministratorVerification(self, Session: object) -> bool:
Parameters:
Session: Objects returned using the 'EnableSession' function
'''
if (Session):
pass
else:
Session = self.session
if (not self.UserLoginAuthentication(Session)): return None
self.Pulling()
try:
Expand Down

0 comments on commit d121d04

Please sign in to comment.