How ghostfrankwu/sustech_tools works
Main components
• Main Program (main.py): This is the central controller that orchestrates the course selection process.
• Configuration/Input File (class.txt): Contains the list of courses (ordered by priority) that the script should attempt to register for.
• External Systems:
• TIS Server: The course registration system which the script communicates with.
• CAS (Central Authentication Service): Used for login/authentication where applicable.
• Visual Components (screenShots folder): Contains images for help and UI feedback, which, while not functional components of the code, give context about the user interface.
Relationships and interactions
• The script (main.py) reads the course configuration from class.txt on startup.
• It then enters a loop (triggered when the user presses return) that, every 3 seconds, attempts to register the highest-priority course. This involves:
• Constructing and sending network requests to the TIS system.
• Dealing with authentication through CAS where necessary.
• The documentation (README) describes how the request scheduling works (priority order, manual intervention to skip courses), so include a component for flow management/control logic.
Architectural patterns or design principles
• Separation of Concerns: Even though it’s a single Python file, there is a clear distinction between:
• Data Input (course list from class.txt)
• Processing Logic (course selection loop and request dispatch)
• Network Communication (interaction with TIS and CAS endpoints)
• Dependency on external systems is critical (TIS, CAS), so ensure these are clearly depicted.
• Timing and concurrency (multiple cycles if the enter key is pressed) are also factors – indicate that the script might run concurrent time-cycles.
Relevant technologies and frameworks
• Python 3 (with a minimal version requirement of 3.6+)
• Standard libraries for network operations (likely requests or similar, though not explicitly shown in the file tree)
• Any additional libraries if imported in main.py (though not exposited in the tree, it may be inferred from the operational context).
• Data flow within a single executable script:
• Input (class.txt) → Core Logic (main.py: reading, decision making, timing loop) → Network Communication (interacting with TIS and CAS).
• Although not a full-stack application with distinct frontend and backend layers, mark the boundaries between local processing (the script’s logic) and external service interactions.
• For completeness, designate external dependencies and note any user-triggered events (the manual skip via enter key).
• “Configuration Input (class.txt)”
• “Main Control Loop (main.py)” with a note on “3-second cycle, priority-based selection”
• “TIS Backend Service” and “CAS Authentication Service”
• “User Interface / Visual Feedback” indicating where screenshots are used for help and interface display.
• Another for processing logic (main.py),
• And a third for external services (TIS, CAS).