-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/opt/homebrew/bin/bash | ||
|
||
## Change the directory to root directory of the project | ||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
ROOT_DIR=$(dirname "$(dirname "$SCRIPT_DIR")") | ||
cd "${ROOT_DIR}" >/dev/null 2>&1 || { echo "[ERROR]: Failed to cd into root directory of the project" && exit 1; } | ||
|
||
nvim pyproject.toml # Update the version | ||
rm -rf dist/ # Delete previous builds | ||
python3 -m build # Build | ||
twine upload --repository testpypi dist/* # Upload to test.pypi | ||
pip uninstall iitkgp_erp_login # Uninstall previous version | ||
version=$(grep -i "version = " pyproject.toml | cut -d'"' -f2) # Get the latest version | ||
pip install -i https://test.pypi.org/simple/ iitkgp-erp-login=="${version}" 2>/dev/null || echo "..." # Just ignore this | ||
pip install -i https://test.pypi.org/simple/ iitkgp-erp-login=="${version}" # Get the latest version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
## Change the directory to root directory of the project | ||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
ROOT_DIR=$(dirname "$(dirname "$SCRIPT_DIR")") | ||
cd "${ROOT_DIR}" >/dev/null 2>&1 || { echo "[ERROR]: Failed to cd into root directory of the project" && exit 1; } | ||
|
||
# cp -a ./src/iitkgp_erp_login/* ./venv/lib/python3.*/site-packages/iitkgp_erp_login/ | ||
cp -a ./src/iitkgp_erp_login/* /opt/homebrew/lib/python3.*/site-packages/iitkgp_erp_login/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import re | ||
import requests | ||
import time | ||
import erpcreds as erpcreds | ||
import iitkgp_erp_login.erp as erp | ||
|
||
headers = { | ||
'timeout': '20', | ||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/51.0.2704.79 Chrome/51.0.2704.79 Safari/537.36', | ||
} | ||
session = requests.Session() | ||
|
||
# erp.login(headers, session, LOGGING=True) | ||
erp.login(headers, session, ERPCREDS=erpcreds, LOGGING=True) | ||
# erp.login(headers, session, ERPCREDS=erpcreds, OTP_CHECK_INTERVAL=2, LOGGING=True) | ||
# while True: | ||
# sessionToken, ssoToken = erp.login(headers, session, ERPCREDS=erpcreds, OTP_CHECK_INTERVAL=2, LOGGING=True, SESSION_STORAGE_FILE='.session') | ||
# r = session.get(erp.WELCOMEPAGE_URL) | ||
|
||
# status_code = r.status_code | ||
# if status_code == 200: | ||
# print(r.text) | ||
# content_length = r.headers.get("Content-Length") | ||
# break |