Skip to content

Commit

Permalink
feat(minor): Providing developer access to ROLL_NUMBER
Browse files Browse the repository at this point in the history
  • Loading branch information
proffapt committed Aug 11, 2023
1 parent 47450e3 commit e5eec6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ The function can also be provided with these _optional_ arguments:
1. [sessionToken](https://en.wikipedia.org/wiki/Session_ID)
2. [ssoToken](https://en.wikipedia.org/wiki/Single_sign-on)
2. It also modifies the `session` object, which now includes parameters for the logged-in session. This `session` object can be utilized for further navigation within the ERP system.
3. `ROLL_NUMBER` is made available for further usage in the following manner.
```python
import iitkgp_erp_login.erp as erp
sessionToken, ssoToken = erp.login(headers, session)

print('Roll Number =', erp.ROLL_NUMBER)
```

<div id="login-usage"></div>

Expand Down
2 changes: 2 additions & 0 deletions src/iitkgp_erp_login/erp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
logging.basicConfig(level=logging.INFO)
sessionToken = ""
ROLL_NUMBER = ""

class ErpLoginError(Exception):
pass


def login(headers, session, ERPCREDS=None, OTP_CHECK_INTERVAL=None, LOGGING=False, SESSION_STORAGE_FILE=None):
global sessionToken
global ROLL_NUMBER
ssoToken = None
if len(sys.argv) == 1 and sys.argv[0] == '-c':
caller_file = None
Expand Down

0 comments on commit e5eec6f

Please sign in to comment.