INNER CODE UNIT · Python

stop_server

buzzsubash/algo_trading_strategies_india · broker-utilities/zerodha-kite-connect-auto-login.py:169

    def stop_server(self):
        """Stop the Flask server"""
        if self.server:
            self.server.shutdown()
            logging.info('Server stopped')

    def save_access_token(self, access_token):
        """Save access token to specified file path"""
        try:
            # Create directory if it doesn't exist
            os.makedirs(os.path.dirname(self.config.ACCESS_TOKEN_PATH), exist_ok=True)

            # Save access token to file
            with open(self.config.ACCESS_TOKEN_PATH, 'w') as token_file:
                token_file.write(access_token)

            logging.info(f"Access token saved successfully to: {self.config.ACCESS_TOKEN_PATH}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…