Skip to content

Commit 5d34ef6

Browse files
committed
Update temp
1 parent 879ff44 commit 5d34ef6

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

patchwork/patchflows/Temp/Temp.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
from datetime import datetime
2+
import os
3+
4+
from patchwork.step import Step
5+
from patchwork.steps import BrowserUse
6+
from typing import Tuple, List
7+
8+
upi_url = "https://10.142.27.8/UPI/login"
9+
m2p_url = "http://qa-jiocbs.m2pfintech.dev/dashboard/login"
10+
files: List[Tuple[str, List[str]]] = [("POS Settlement", []), ("IMPS Settlement", []), ("Wallet Transactions", [])]
11+
end_of_task = "Then leave the rest for the user. Your job is done."
12+
13+
14+
browser_use_defaults = dict(
15+
google_api_key=os.getenv("GOOGLE_API_KEY"),
16+
generate_gif=True,
17+
headless=False,
18+
task_value={},
19+
)
20+
21+
22+
def create_inputs(task: str, **kwargs):
23+
cloned_dict = browser_use_defaults.copy()
24+
cloned_dict.update(**kwargs)
25+
cloned_dict["task"] = task + "\n" + end_of_task
26+
return cloned_dict
27+
28+
29+
class Temp(Step):
30+
def run(self):
31+
date = datetime.now().strftime("%d-%b-%Y")
32+
os.makedirs(f"tmp/working_files/{date}", exist_ok=True)
33+
for file_type in ["Raw Data", "Merchant Raw Data", "PSP Raw data"]:
34+
BrowserUse(
35+
create_inputs(
36+
task=f"""
37+
Go to {upi_url}
38+
Login using username `9167471523` and password `Patched#1901`
39+
40+
Click on File Download
41+
Click on Settlement Files Download
42+
43+
In From date enter {date}, and in To date enter {date}
44+
In Cycle Name select All
45+
Select File Type {file_type} and click on 'File Search'.
46+
It will give you 10 files. Click on the download button of each file.
47+
"""
48+
)
49+
).run()
50+
51+
return {}

patchwork/patchflows/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .PRReview.PRReview import PRReview
1010
from .ResolveIssue.ResolveIssue import ResolveIssue
1111
from .SonarFix.SonarFix import SonarFix
12+
from .Temp.Temp import Temp
1213

1314
__all__ = [
1415
"AutoFix",
@@ -22,4 +23,5 @@
2223
"GenerateCodeUsageExample",
2324
"SonarFix",
2425
"LogAnalysis",
26+
"Temp",
2527
]

0 commit comments

Comments
 (0)