robotframework-roboview 0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- robotframework_roboview-0.0.1.dist-info/METADATA +239 -0
- robotframework_roboview-0.0.1.dist-info/RECORD +66 -0
- robotframework_roboview-0.0.1.dist-info/WHEEL +4 -0
- robotframework_roboview-0.0.1.dist-info/licenses/LICENSE.txt +202 -0
- roboview/__init__.py +1 -0
- roboview/api/__init__.py +1 -0
- roboview/api/endpoints/__init__.py +19 -0
- roboview/api/endpoints/files/__init__.py +15 -0
- roboview/api/endpoints/files/all_files.py +50 -0
- roboview/api/endpoints/files/resource_files.py +47 -0
- roboview/api/endpoints/files/robot_files.py +47 -0
- roboview/api/endpoints/keyword_usage/__init__.py +30 -0
- roboview/api/endpoints/keyword_usage/keyword_duplicates.py +43 -0
- roboview/api/endpoints/keyword_usage/keyword_similarity.py +45 -0
- roboview/api/endpoints/keyword_usage/keyword_usage_resource.py +44 -0
- roboview/api/endpoints/keyword_usage/keyword_usage_robot.py +44 -0
- roboview/api/endpoints/keyword_usage/keywords_called.py +48 -0
- roboview/api/endpoints/keyword_usage/keywords_initialized.py +45 -0
- roboview/api/endpoints/keyword_usage/keywords_wo_documentation.py +39 -0
- roboview/api/endpoints/keyword_usage/keywords_wo_usages.py +39 -0
- roboview/api/endpoints/overview/__init__.py +15 -0
- roboview/api/endpoints/overview/kpis.py +60 -0
- roboview/api/endpoints/overview/most_used_keywords.py +47 -0
- roboview/api/endpoints/overview/robocop_summary.py +41 -0
- roboview/api/endpoints/robocop/__init__.py +13 -0
- roboview/api/endpoints/robocop/robocop_message.py +40 -0
- roboview/api/endpoints/robocop/robocop_messages.py +39 -0
- roboview/api/endpoints/system/__init__.py +13 -0
- roboview/api/endpoints/system/health.py +32 -0
- roboview/api/endpoints/system/initialize.py +79 -0
- roboview/core/__init__.py +1 -0
- roboview/core/config.py +46 -0
- roboview/core/logging.py +27 -0
- roboview/main.py +78 -0
- roboview/models/__init__.py +1 -0
- roboview/models/robot_parsing/__init__.py +1 -0
- roboview/models/robot_parsing/called_keyword_parsing.py +100 -0
- roboview/models/robot_parsing/keyword_dependency_parsing.py +106 -0
- roboview/models/robot_parsing/local_keyword_parsing.py +134 -0
- roboview/models/robot_parsing/resource_dependency_parsing.py +57 -0
- roboview/registries/__init__.py +1 -0
- roboview/registries/file_registry.py +84 -0
- roboview/registries/keyword_registry.py +152 -0
- roboview/registries/robocop_registry.py +83 -0
- roboview/schemas/__init__.py +1 -0
- roboview/schemas/domain/__init__.py +1 -0
- roboview/schemas/domain/common.py +26 -0
- roboview/schemas/domain/files.py +29 -0
- roboview/schemas/domain/keywords.py +46 -0
- roboview/schemas/domain/robocop.py +54 -0
- roboview/schemas/dtos/__init__.py +1 -0
- roboview/schemas/dtos/common.py +30 -0
- roboview/schemas/dtos/files.py +22 -0
- roboview/schemas/dtos/keyword_similarity.py +16 -0
- roboview/schemas/dtos/keyword_usage.py +43 -0
- roboview/schemas/dtos/overview.py +31 -0
- roboview/schemas/dtos/robocop.py +22 -0
- roboview/services/__init__.py +1 -0
- roboview/services/file_register_service.py +138 -0
- roboview/services/keyword_register_service.py +202 -0
- roboview/services/keyword_similarity_service.py +203 -0
- roboview/services/keyword_usage_service.py +494 -0
- roboview/services/robocop_register_service.py +352 -0
- roboview/services/robocop_service.py +91 -0
- roboview/utils/__init__.py +1 -0
- roboview/utils/directory_parsing.py +53 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: robotframework-roboview
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: RoboView is a Visual Studio Code extension designed to help you manage keywords within your Robot Framework projects and improve overall test quality through built-in Robocop integration. Its primary goal is to provide a comprehensive overview of all keywords and their relationships, making it easier to understand and maintain your test automation codebase.
|
|
5
|
+
License: Apache 2.0
|
|
6
|
+
License-File: LICENSE.txt
|
|
7
|
+
Author: viadee Unternehmensberatung AG
|
|
8
|
+
Requires-Python: >=3.10,<3.14
|
|
9
|
+
Classifier: License :: Other/Proprietary License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Requires-Dist: coloredlogs (>=15.0.1,<16.0.0)
|
|
16
|
+
Requires-Dist: fastapi (>=0.115.8,<0.116.0)
|
|
17
|
+
Requires-Dist: httpx (>=0.28.1,<0.29.0)
|
|
18
|
+
Requires-Dist: numpy (>=2.2.4,<3.0.0)
|
|
19
|
+
Requires-Dist: pydantic (>=2.11.4,<3.0.0)
|
|
20
|
+
Requires-Dist: pydantic-settings (>=2.12.0,<3.0.0)
|
|
21
|
+
Requires-Dist: pygments (>=2.19.1,<3.0.0)
|
|
22
|
+
Requires-Dist: robotframework (>=7.2.2,<8.0.0)
|
|
23
|
+
Requires-Dist: robotframework-browser (>=19.12.4,<20.0.0)
|
|
24
|
+
Requires-Dist: robotframework-crypto (>=0.4.2,<0.5.0)
|
|
25
|
+
Requires-Dist: robotframework-databaselibrary (>=2.4.1,<3.0.0)
|
|
26
|
+
Requires-Dist: robotframework-robocop (>=7.2.0,<8.0.0)
|
|
27
|
+
Requires-Dist: robotframework-seleniumlibrary (>=6.8.0,<7.0.0)
|
|
28
|
+
Requires-Dist: scikit-learn (>=1.6.1,<2.0.0)
|
|
29
|
+
Requires-Dist: starlette (>=0.46.0,<0.47.0)
|
|
30
|
+
Requires-Dist: uvicorn (>=0.34.0,<0.35.0)
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# RoboView - Keyword Management in Robot Framework
|
|
34
|
+

|
|
35
|
+
[](https://pypi.org/project/robotframework-roboview/)
|
|
36
|
+

|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
RoboView is a Visual Studio Code extension designed to help you manage keywords within your Robot Framework projects and improve overall test quality through built-in Robocop integration. Its primary goal is to provide a comprehensive overview of all keywords and their relationships, making it easier to understand and maintain your test automation codebase.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## ✨ Key Features
|
|
45
|
+
|
|
46
|
+
- 🗂️ **Workspace:** Automatically selects your current workspace project and generates comprehensive overviews.
|
|
47
|
+
- 📈 **Dashboard:** Get key performance indicators and a general overview of your robot framework project.
|
|
48
|
+
- 📝 **Keyword Overview & Filtering:** Instantly view all keywords of a selected file, filter by type (initialized, called).
|
|
49
|
+
- ❓ **Global Filter:** Searches your files for any keywords lacking documentation, unused keywords or faulty keywords with cycle calling.
|
|
50
|
+
- 📖 **Detailed Keyword Insights:** Select any keyword to see where it is defined, how often it is used (both in its own file and across the project), and view its documentation.
|
|
51
|
+
- 🧩 **Similarity Detection:** Get information about similar or potentially duplicate keywords through similarity analysis of keyword source code.
|
|
52
|
+
- 🧭 **Code Navigation:** Jump straight to a keyword’s definition with a simple Ctrl+Click.
|
|
53
|
+
- 🛡️ **Robocop Integration:** Runs Robocop directly from within RoboView, inspect lint results in context, and use your custom configuration file (e.g. robocop.toml) out of the box.
|
|
54
|
+
- 🔍 **Search & Sorting:** Quickly find keywords using the search bar and sort them by name or usage statistics.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## ⚙️ Installation Guide
|
|
59
|
+
|
|
60
|
+
RoboView consists of two parts: a **backend** (Python package) and a **frontend** (Visual Studio Code extension).
|
|
61
|
+
|
|
62
|
+
### ✅ Backend
|
|
63
|
+
|
|
64
|
+
Install the backend via **pip**:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install robotframework-roboview
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### ✅ Frontend
|
|
71
|
+
|
|
72
|
+
The Frontend is available as a Visual Studio Code extension on the Marketplace – install it in seconds from the VS Code Extensions view.
|
|
73
|
+
1. Open **Visual Studio Code**.
|
|
74
|
+
2. Go to the **Extensions** view (`Ctrl+Shift+X` / `Cmd+Shift+X`).
|
|
75
|
+
3. Search for **"RoboView"**.
|
|
76
|
+
4. Install the RoboView extension by *viadee Unternehmensberatung AG*.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 🛠️ GitHub
|
|
81
|
+
|
|
82
|
+
You can find the RoboView source code and issue tracker on GitHub:
|
|
83
|
+
|
|
84
|
+
👉 **https://github.com/viadee/robotframework-roboview**
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 📝 Notes and Recommendations
|
|
89
|
+
|
|
90
|
+
- For Robocop to automatically detect your configuration, name the file **`robocop.toml`**, **`robot.toml`** or integrate in **`pyproject.toml`**.
|
|
91
|
+
If you cannot change the filename in your project, you can instead set the environment variable **`ROBOCOP_CONFIG_PATH`** to the full path of your config file.
|
|
92
|
+
- If the Robocop configuration file is outdated or cannot be parsed, RoboView falls back to **Robocop’s default settings**. The same applies if no configuration file is found.
|
|
93
|
+
- RoboView follows your IDE’s color theme. We recommend using a **dark theme**, as text in light themes can be harder to read - but feel free to experiment and choose what works best for you.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 🔍 How to navigate RoboView
|
|
98
|
+
|
|
99
|
+
In the following three sections, we will dive deeper into how to navigate RoboView: where to find the features and understand the terminology we use. We start with the dashboard, then look at the keyword usage overview, and finally the Robocop integration.
|
|
100
|
+
You can switch between these views using the buttons in the top-right corner of RoboView: <code>Dashboard</code>, <code>Keyword Usage</code>, and <code>Robocop</code>.
|
|
101
|
+
|
|
102
|
+
## 📋 1) Dashboard
|
|
103
|
+
|
|
104
|
+
The **Dashboard** gives you a high‑level overview of the selected Robot Framework project and its overall health.
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
<p align="center">
|
|
108
|
+
<img src="./static/dashboard_1.png" alt="keyword_list" width="900"/>
|
|
109
|
+
</p>
|
|
110
|
+
<p align="center">
|
|
111
|
+
<img src="./static/dashboard_2.png" alt="keyword_list" width="900"/>
|
|
112
|
+
</p>
|
|
113
|
+
|
|
114
|
+
<br>
|
|
115
|
+
|
|
116
|
+
At the top of the dashboard you’ll see the **Selected Project**. RoboView automatically detects your current workspace and shows:
|
|
117
|
+
- The **project name**
|
|
118
|
+
- The **absolute path** to the project root
|
|
119
|
+
|
|
120
|
+
This ensures all metrics are calculated against the correct `.robot` and `.resource` files.
|
|
121
|
+
|
|
122
|
+
### KPIs
|
|
123
|
+
|
|
124
|
+
The **KPIs** section summarizes the most important metrics of your test suite:
|
|
125
|
+
- **User Defined Keywords**: Total number of custom keywords found in your project.
|
|
126
|
+
- **Keyword Reuse Rate**: Percentage of keywords that are used more than once. A higher value indicates better reuse and less duplication/redundancy.
|
|
127
|
+
- **Unused Keywords**: Number of keywords that are never called anywhere in the project. Use this to identify dead code and candidates for cleanup.
|
|
128
|
+
- **Robocop Issues**: Total number of Robocop violations detected across the project. This helps you quickly assess structural and style problems in your tests.
|
|
129
|
+
- **Documentation Coverage**: Percentage of keywords that contain a `[Documentation]` section. A higher value means your test suite is better documented and easier to maintain.
|
|
130
|
+
- **Robot Framework Files**: Total number of `.robot` and `.resource` files that were analyzed. Use the dashboard to quickly spot problematic areas (e.g. many unused keywords, low documentation coverage, or a high number of Robocop issues) and decide where to focus your refactoring or cleanup efforts first.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
## 🌳 2) Keyword Overview
|
|
134
|
+
|
|
135
|
+
<p align="center" style="margin-bottom: 0.5em;">
|
|
136
|
+
<strong>Keyword Overview Layout</strong>
|
|
137
|
+
</p>
|
|
138
|
+
<p align="center" style="font-family: monospace; line-height: 1.4; white-space: pre;">
|
|
139
|
+
[ Left: File Navigation & Keyword Filters ] [ Middle: Keyword List ] [ Right: Keyword Details ]
|
|
140
|
+
</p>
|
|
141
|
+
|
|
142
|
+
<p align="center">
|
|
143
|
+
<img src="./static/keyword_usage.png" alt="graph_view" width="900"/>
|
|
144
|
+
</p>
|
|
145
|
+
|
|
146
|
+
<br>
|
|
147
|
+
|
|
148
|
+
### ⬅️ Left Side – Navigation & Filters
|
|
149
|
+
|
|
150
|
+
- <strong>File Selection:</strong> At the top, a dropdown lets you select a file. The current VS Code workspace is used as root, and all
|
|
151
|
+
<code>.robot</code> and <code>.resource</code> files are available.
|
|
152
|
+
- <strong>Type Filter:</strong> Choose which group of keywords to display for the selected file:
|
|
153
|
+
- <strong>All Keywords:</strong> Shows every keyword that is either defined in or used by the selected file.
|
|
154
|
+
- <strong>Initialized Keywords:</strong> Only keywords that are defined/implemented in the selected file.
|
|
155
|
+
- <strong>Called Keywords:</strong> Only keywords that are used in the selected file but defined elsewhere.
|
|
156
|
+
- <strong>Global Filter:</strong> Jump directly to common problem areas across the entire project:
|
|
157
|
+
- <strong>Keywords without Documentation:</strong> Keywords that are missing documentation.
|
|
158
|
+
- <strong>Unused Keywords:</strong> Keywords that are never called in any analyzed file.
|
|
159
|
+
- <strong>Keywords with Calling Cycles:</strong> Keywords that participate in cyclic calls (A calls B, B calls A, etc.), which can indicate design or maintainability issues.
|
|
160
|
+
|
|
161
|
+
<br>
|
|
162
|
+
|
|
163
|
+
### 📊 Middle – Keyword List
|
|
164
|
+
|
|
165
|
+
The middle section lists all keywords found in the selected file and shows key information about each of them:
|
|
166
|
+
|
|
167
|
+
- <strong>Origin indicator:</strong> A color-coded label to the left of the keyword name shows where the keyword comes from:
|
|
168
|
+
- <strong>U</strong>: User-defined keyword.
|
|
169
|
+
- <strong>E</strong>: External keyword (e.g. from <code>BuiltIn</code> or libraries like <code>Browser</code>).
|
|
170
|
+
- <strong>Definition location:</strong> The file in which the keyword is defined.
|
|
171
|
+
- <strong>File-local usage count:</strong> How often the keyword is used (called) in the selected file.
|
|
172
|
+
- <strong>Project-wide usage count:</strong> How often the keyword is used across all <code>.robot</code> and <code>.resource</code> files in the current project.
|
|
173
|
+
|
|
174
|
+
<br>
|
|
175
|
+
|
|
176
|
+
### ➡️ Right Side – Keyword Details
|
|
177
|
+
|
|
178
|
+
When you select a keyword (by clicking a row in the middle table), the right panel shows detailed information:
|
|
179
|
+
|
|
180
|
+
- <strong>Documentation:</strong> The keyword’s documentation as defined in the source code.
|
|
181
|
+
- <strong>Usage across files:</strong> In which <code>.robot</code> and <code>.resource</code> files the keyword is used, and how often in each file.
|
|
182
|
+
- <strong>Similarity analysis:</strong> A list of up to five keywords that are most similar to the selected one, based on its name and source code using term-frequency-based similarity.
|
|
183
|
+
|
|
184
|
+
<br>
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
<h3 style="border-bottom: none; margin-bottom: 1em;">🛡️ 3) Robocop</h3>
|
|
189
|
+
|
|
190
|
+
The **Robocop** view integrates the `https://robocop.readthedocs.io/` linter directly into RoboView, so you can spot and fix structural and style issues in your Robot Framework tests without leaving VS Code.
|
|
191
|
+
|
|
192
|
+
<p align="center" style="margin-bottom: 0.5em;">
|
|
193
|
+
<strong>Robocop Issues Layout</strong>
|
|
194
|
+
</p>
|
|
195
|
+
<p align="center" style="font-family: monospace; line-height: 1.4; white-space: pre;">
|
|
196
|
+
[ Left: Error Overview ] [ Middle: Error List ] [ Right: Error Details ]
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
<p align="center">
|
|
200
|
+
<img src="./static/robocop.png" alt="robocop_issues" width="900"/>
|
|
201
|
+
</p>
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
<br>
|
|
205
|
+
|
|
206
|
+
### How it works
|
|
207
|
+
|
|
208
|
+
- **Left: Error Overview**
|
|
209
|
+
The left panel shows a compact **overview of all detected issues**, for example:
|
|
210
|
+
- Total number of Robocop findings
|
|
211
|
+
- Issues grouped by **rule** or **category**
|
|
212
|
+
- A quick way to see which types of problems are most common
|
|
213
|
+
This helps you understand the overall state of your project at a glance.
|
|
214
|
+
- **Middle: Error List**
|
|
215
|
+
The middle panel contains the **list of individual Robocop issues**.
|
|
216
|
+
Each entry typically shows:
|
|
217
|
+
- The **file** where the issue was found
|
|
218
|
+
- The **rule id** and short **message**
|
|
219
|
+
- The **line** number in the file
|
|
220
|
+
|
|
221
|
+
You can scroll through this list and select a specific issue to inspect it in detail.
|
|
222
|
+
|
|
223
|
+
- **Right: Error Details**
|
|
224
|
+
The right panel displays **details for the currently selected issue**, including:
|
|
225
|
+
- The full Robocop message
|
|
226
|
+
- The rule id and its description
|
|
227
|
+
- The file and line information
|
|
228
|
+
- Additional context that helps you understand why this issue was reported
|
|
229
|
+
|
|
230
|
+
<br>
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## 🔮 Outlook
|
|
235
|
+
|
|
236
|
+
RoboView is an actively evolving project. ✨
|
|
237
|
+
We’re continuously adding new features, polishing existing workflows, and exploring fresh ideas to make working with Robot Framework even more enjoyable. 💡
|
|
238
|
+
|
|
239
|
+
We’re happy to have you along for the journey – stay tuned for new releases and improvements! 🚀
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
roboview/__init__.py,sha256=6uTa93VoLR7ksrcpyicJgNF7-OdhsicKfLz2Pz5LzC8,44
|
|
2
|
+
roboview/api/__init__.py,sha256=cKrkCOND55dj-_gHzx3HGEi_eEK9A-DN2jQQ2idMaFI,41
|
|
3
|
+
roboview/api/endpoints/__init__.py,sha256=qF9rECvZKRKrIqhRHvricV6hnL7vm18pJtYsdaYDc5Q,852
|
|
4
|
+
roboview/api/endpoints/files/__init__.py,sha256=ci2ZQSAWDfoFB6LMQdhyhFk3UY5uY5z1e6-Xfu6j1Fw,575
|
|
5
|
+
roboview/api/endpoints/files/all_files.py,sha256=HZBMZCCkg57FoYY6qU_cPxuwVLNxS8fTezYoIkLGS_c,1849
|
|
6
|
+
roboview/api/endpoints/files/resource_files.py,sha256=Kvub0tUcSzuEGn44fkERYR7qgS0v7AoptYXagauYfQ4,1646
|
|
7
|
+
roboview/api/endpoints/files/robot_files.py,sha256=8J59o2cYIQB_Fc7sGgO06KG5cUZ7K3yeH-4WRsXaxzQ,1608
|
|
8
|
+
roboview/api/endpoints/keyword_usage/__init__.py,sha256=xycXkE64aw_4hfuJOEOLnJ5K8k2ZKbAm02XTGt4w75g,1756
|
|
9
|
+
roboview/api/endpoints/keyword_usage/keyword_duplicates.py,sha256=cJIr_mMFC4lS-YrcrqCkviStsI4VEBxyVGaAA_ZI2GM,1602
|
|
10
|
+
roboview/api/endpoints/keyword_usage/keyword_similarity.py,sha256=VGER_ulARroRwcI_Y6DvNMHhHGhXQFTSRJBY2TE67vk,1732
|
|
11
|
+
roboview/api/endpoints/keyword_usage/keyword_usage_resource.py,sha256=8ryaeIj8cY38KKTqJ3CUKqPkUECSFAITKGqrxyiBWZc,1800
|
|
12
|
+
roboview/api/endpoints/keyword_usage/keyword_usage_robot.py,sha256=DCLkBv6hSz54Wq4naTrQBN_5PjI7XaYQ1H5WcdGqv3c,1710
|
|
13
|
+
roboview/api/endpoints/keyword_usage/keywords_called.py,sha256=PGlvtwmlFY3s8WmeciUkNcvYLwUdw8-B-0E0Hqyl2d4,1838
|
|
14
|
+
roboview/api/endpoints/keyword_usage/keywords_initialized.py,sha256=LGhoYsmUeIThYMlrVb-gQi2J37cKkqJqfglpvzfkaYE,1741
|
|
15
|
+
roboview/api/endpoints/keyword_usage/keywords_wo_documentation.py,sha256=biuH2fOj0TalG16G0EIl88UcaaZbbBbKm_3uhgzfSDw,1492
|
|
16
|
+
roboview/api/endpoints/keyword_usage/keywords_wo_usages.py,sha256=hBYnk_GFLcg3rq6gAR5zsWBFzJRsV59onGLvw_70J8c,1499
|
|
17
|
+
roboview/api/endpoints/overview/__init__.py,sha256=62DpqM0YPdM6BEpa5z7chRMsEWYKmkHinjKuvqnFA7g,656
|
|
18
|
+
roboview/api/endpoints/overview/kpis.py,sha256=PNj1ZUaCcLgQf-xgHBqWsQ3vZ8ND8bBgKpAGd-1dCcg,2445
|
|
19
|
+
roboview/api/endpoints/overview/most_used_keywords.py,sha256=YbrxrhXTnrdNlhNPoQFLHJX-7g_H-ItQRZPVH9jwLx0,1734
|
|
20
|
+
roboview/api/endpoints/overview/robocop_summary.py,sha256=Jqas_s_qxDW8UiKy0fr4ZVQo0eLhE5wjWvXxlgmZ234,1391
|
|
21
|
+
roboview/api/endpoints/robocop/__init__.py,sha256=eHV68dozaXE_mOs3nzIDaPZZh647fys44iQww89dlUU,530
|
|
22
|
+
roboview/api/endpoints/robocop/robocop_message.py,sha256=ouERgBcJ7uVqrgpEhJUZ1uAvyqvat-TuPJVe7oKYCRs,1382
|
|
23
|
+
roboview/api/endpoints/robocop/robocop_messages.py,sha256=t0eh5l6c4bHLEuL_pO6SePCLOkeEIV6BlGYunjeN73Q,1307
|
|
24
|
+
roboview/api/endpoints/system/__init__.py,sha256=QLOsZB2WDpiZDMVX3g6Xps5EQThTFNFGxlaMkrcw3y4,445
|
|
25
|
+
roboview/api/endpoints/system/health.py,sha256=eAL9laQbr9e3kZ9WRBHZyVq52AIFF7ZHn2qEo-_meRc,889
|
|
26
|
+
roboview/api/endpoints/system/initialize.py,sha256=1HBfUvekq2R78bRvBYBks04ql86CTe5xgq6SD59A8ZQ,3487
|
|
27
|
+
roboview/core/__init__.py,sha256=QP6hRiLF3dEHk_vIfqi-_tH5OsYtq7670jSGUzQAL4E,36
|
|
28
|
+
roboview/core/config.py,sha256=E9tP9soU1GHVIyjsjXVWtrTzNpvlmXpfHThF3OVUbnI,1299
|
|
29
|
+
roboview/core/logging.py,sha256=ZGKb5uUvYuzZ9V-2wJ5n2545LlXQ_TAnZTZlJ3RDL84,962
|
|
30
|
+
roboview/main.py,sha256=n9CStDxRge6EWTbvlpnEx8fcUxLpPX0Be5vm4gVTa70,2408
|
|
31
|
+
roboview/models/__init__.py,sha256=52ISoclykgEh4LcNqq0f43oNui8LvMLTPxRZxme1B1Q,56
|
|
32
|
+
roboview/models/robot_parsing/__init__.py,sha256=MrTk6CBK2mc7nJ90S43JzWv1cwHiu7A4wJsjO0RDC0Q,54
|
|
33
|
+
roboview/models/robot_parsing/called_keyword_parsing.py,sha256=cpINl205T-2aGxHtGFInaSAluG_m4RrSfpIxgx2pwqI,3087
|
|
34
|
+
roboview/models/robot_parsing/keyword_dependency_parsing.py,sha256=hDpMZTQJNPgCT5eSq4LTbLxNG5uPY482irLSR_XnkIo,3706
|
|
35
|
+
roboview/models/robot_parsing/local_keyword_parsing.py,sha256=RBNg0ZtusmyH3hH5aAqfv35nUHRXUCI5EU7t4lCl2dA,4624
|
|
36
|
+
roboview/models/robot_parsing/resource_dependency_parsing.py,sha256=_51uLB1lEHJ5i8h11u6lAoZSRpuLB-HdKHh5GxrHFUw,2132
|
|
37
|
+
roboview/registries/__init__.py,sha256=JD0qejGEPk88OuY534o4c6IH7cuDXeFaU1Yuro5mg1g,49
|
|
38
|
+
roboview/registries/file_registry.py,sha256=PC99-5qTSJRAaR1lJZhS0w4akcTzeODpvDVbyM79DNk,2510
|
|
39
|
+
roboview/registries/keyword_registry.py,sha256=szWFkUWjnD3p1N7-KLFUZ2k7K4DQA4eAQNW9ZwYohN0,5290
|
|
40
|
+
roboview/registries/robocop_registry.py,sha256=CL4mIgV-wwUkoziz4n_2SdGHVAQQy6XCrM4X-PO7VZE,2657
|
|
41
|
+
roboview/schemas/__init__.py,sha256=4klNgtMQDzHEGLZwFwwhVUpqWctLEnp3LaWQEqfBUBk,40
|
|
42
|
+
roboview/schemas/domain/__init__.py,sha256=lVf5u73G5FdR5ORbp50bz4fv5kl8qoFfqViVAm_f-FA,47
|
|
43
|
+
roboview/schemas/domain/common.py,sha256=9Q3Y_c0tPyjNGHADG3qDuWHWcalV8CIielIkB1VHtSs,538
|
|
44
|
+
roboview/schemas/domain/files.py,sha256=wMV6NyfPKThU0Kh5spuiqjTECUKhhfde9L9hE_eLJ7o,1411
|
|
45
|
+
roboview/schemas/domain/keywords.py,sha256=oiwqT-QY4JIMRBXfYQTWcY45h4ZkrclTI30pIIjDVSU,2763
|
|
46
|
+
roboview/schemas/domain/robocop.py,sha256=bIe8uLy6yU6hnSJ05UcbmG6SIaVZfEWiRNDMF2qsRRA,1882
|
|
47
|
+
roboview/schemas/dtos/__init__.py,sha256=AJVJC_0qDhNTTxmN8iv_-wSBOE2hJvYC0eFDjHvsWBk,44
|
|
48
|
+
roboview/schemas/dtos/common.py,sha256=qxFYIyaaBRa-awnf4_S3OpESmEX3zDOt_RFlZlkkN9k,1091
|
|
49
|
+
roboview/schemas/dtos/files.py,sha256=hWdYGVbKk9awutette__uNGMJT7ihAn2Z4bLbDmFPYA,816
|
|
50
|
+
roboview/schemas/dtos/keyword_similarity.py,sha256=QM8AQIY5ALBx8umkvMmrUPL5S18LPlL6y7sO236z5IY,662
|
|
51
|
+
roboview/schemas/dtos/keyword_usage.py,sha256=C6s_1HiOsSx6NyUmasIlzST1Go1JQAWUBmLVVGygWWI,1649
|
|
52
|
+
roboview/schemas/dtos/overview.py,sha256=cNiDEO9aUi0LSDZUn_X2qFsRmdn7RVCgVh8MTjLGhfA,1438
|
|
53
|
+
roboview/schemas/dtos/robocop.py,sha256=e_PdSaNeRXsnRVu820PdYmibs4WE-BMrhYHvp6sg3i4,755
|
|
54
|
+
roboview/services/__init__.py,sha256=McMITp72tWI_50NHY8s7-Kfk6sWXzwmxn_K0Ba0RCR4,41
|
|
55
|
+
roboview/services/file_register_service.py,sha256=1nvNlk5M8lRqWWye92VeMRaMdh-B9WBMccjMIn_hRxQ,5222
|
|
56
|
+
roboview/services/keyword_register_service.py,sha256=cQynPZBVylcZps5Wk03sV0GQdcpgEtxNVfNOid-DW1o,7746
|
|
57
|
+
roboview/services/keyword_similarity_service.py,sha256=pVM1XZIPXEi9GCf-xwDANFVXAaX3iDFHkloeuDUNMzo,8304
|
|
58
|
+
roboview/services/keyword_usage_service.py,sha256=bDKLXHPWWF5i3WhFt4oOxHnti16klM3N-sW30iUEvpM,21589
|
|
59
|
+
roboview/services/robocop_register_service.py,sha256=WTnw-SdnLPConmfhUmjO6sYV8qZ4aatketUCnwjJMz8,13549
|
|
60
|
+
roboview/services/robocop_service.py,sha256=cYNIje1X63p2-DFP5RLzeq5w_ecxI-M3DCkEbijMaBo,3190
|
|
61
|
+
roboview/utils/__init__.py,sha256=aeElNBCi1WHj316gbx66npclgEj8pbwpxFs2qjuttfs,50
|
|
62
|
+
roboview/utils/directory_parsing.py,sha256=zhbcCIMl7_nH_n8MSTvNl3na-2Iz7-2yhD69PETYbkI,1989
|
|
63
|
+
robotframework_roboview-0.0.1.dist-info/licenses/LICENSE.txt,sha256=SbvpEU5JIU3yzMMkyzrI0dGqHDoJR_lMKGdl6GZHsy4,11558
|
|
64
|
+
robotframework_roboview-0.0.1.dist-info/METADATA,sha256=THgN28ix_NIN57RQHAuQKXLeB7vfYhUhPG4IuyRLq5M,12329
|
|
65
|
+
robotframework_roboview-0.0.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
66
|
+
robotframework_roboview-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
roboview/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Entrypoint for the RoboView backend."""
|
roboview/api/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Entrypoint for FastAPI endpoints."""
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Central router that bundles all API endpoints."""
|
|
2
|
+
|
|
3
|
+
from fastapi import APIRouter
|
|
4
|
+
|
|
5
|
+
from .files import api_router as files_router
|
|
6
|
+
from .keyword_usage import api_router as keyword_usage_router
|
|
7
|
+
from .overview import api_router as overview_router
|
|
8
|
+
from .robocop import api_router as robocop_router
|
|
9
|
+
from .system import api_router as system_router
|
|
10
|
+
|
|
11
|
+
# Create main API router
|
|
12
|
+
api_router = APIRouter()
|
|
13
|
+
|
|
14
|
+
# Include all endpoint routers
|
|
15
|
+
api_router.include_router(system_router, prefix="/system", tags=["system"])
|
|
16
|
+
api_router.include_router(files_router, prefix="/files", tags=["files"])
|
|
17
|
+
api_router.include_router(keyword_usage_router, prefix="/keyword-usage", tags=["keyword-usage"])
|
|
18
|
+
api_router.include_router(overview_router, prefix="/overview", tags=["overview"])
|
|
19
|
+
api_router.include_router(robocop_router, prefix="/robocop", tags=["robocop"])
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Router that bundles all file related endpoints."""
|
|
2
|
+
|
|
3
|
+
from fastapi import APIRouter
|
|
4
|
+
|
|
5
|
+
from .all_files import router as all_files_router
|
|
6
|
+
from .resource_files import router as resource_router
|
|
7
|
+
from .robot_files import router as robot_router
|
|
8
|
+
|
|
9
|
+
# Create file API router
|
|
10
|
+
api_router = APIRouter()
|
|
11
|
+
|
|
12
|
+
# Include all file endpoint routers
|
|
13
|
+
api_router.include_router(robot_router, prefix="/robot", tags=["robot"])
|
|
14
|
+
api_router.include_router(all_files_router, prefix="/all-files", tags=["all"])
|
|
15
|
+
api_router.include_router(resource_router, prefix="/resource", tags=["resource"])
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Endpoint for retrieving all available robot and resource files."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from fastapi import APIRouter, HTTPException
|
|
7
|
+
from roboview.schemas.domain.files import SelectionFiles
|
|
8
|
+
from roboview.schemas.dtos.files import AllFilesResponse
|
|
9
|
+
from roboview.utils.directory_parsing import DirectoryParser
|
|
10
|
+
|
|
11
|
+
logger = logging.getLogger(__name__)
|
|
12
|
+
router = APIRouter()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@router.get(
|
|
16
|
+
"",
|
|
17
|
+
summary="All available resource and robot files",
|
|
18
|
+
response_model=AllFilesResponse,
|
|
19
|
+
responses={
|
|
20
|
+
200: {"description": "Available resource and robot files retrieved successfully."},
|
|
21
|
+
400: {"description": "Invalid input data."},
|
|
22
|
+
500: {"description": "Internal Server Error."},
|
|
23
|
+
503: {"description": "Service is unavailable."},
|
|
24
|
+
},
|
|
25
|
+
)
|
|
26
|
+
async def all_files(project_root_dir: str): # noqa: ANN201
|
|
27
|
+
"""Endpoint to fetch all resource and robot files.
|
|
28
|
+
|
|
29
|
+
Arguments:
|
|
30
|
+
project_root_dir (str): The project_root_directory path.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
AllFilesResponse: List containing all resource and robot file names.
|
|
34
|
+
|
|
35
|
+
"""
|
|
36
|
+
try:
|
|
37
|
+
selection_files = []
|
|
38
|
+
directory_parser = DirectoryParser(Path(project_root_dir))
|
|
39
|
+
robot_files = directory_parser.get_test_file_paths()
|
|
40
|
+
resource_files = directory_parser.get_resource_file_paths()
|
|
41
|
+
|
|
42
|
+
selection_files.extend(SelectionFiles(file_name=file.name, path=file.as_posix()) for file in robot_files)
|
|
43
|
+
|
|
44
|
+
selection_files.extend(SelectionFiles(file_name=file.name, path=file.as_posix()) for file in resource_files)
|
|
45
|
+
|
|
46
|
+
except Exception as e:
|
|
47
|
+
logger.exception("Error fetching Robot Framework files: ")
|
|
48
|
+
raise HTTPException(status_code=500, detail="Internal Server Error") from e
|
|
49
|
+
else:
|
|
50
|
+
return AllFilesResponse(all_files=selection_files)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Endpoint for retrieving all available resource files."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from fastapi import APIRouter, HTTPException
|
|
7
|
+
from roboview.schemas.domain.files import SelectionFiles
|
|
8
|
+
from roboview.schemas.dtos.files import ResourceFilesResponse
|
|
9
|
+
from roboview.utils.directory_parsing import DirectoryParser
|
|
10
|
+
|
|
11
|
+
logger = logging.getLogger(__name__)
|
|
12
|
+
router = APIRouter()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@router.get(
|
|
16
|
+
"",
|
|
17
|
+
summary="Available resource files",
|
|
18
|
+
response_model=ResourceFilesResponse,
|
|
19
|
+
responses={
|
|
20
|
+
200: {"description": "Available resource files retrieved successfully."},
|
|
21
|
+
400: {"description": "Invalid input data."},
|
|
22
|
+
500: {"description": "Internal Server Error."},
|
|
23
|
+
503: {"description": "Service is unavailable."},
|
|
24
|
+
},
|
|
25
|
+
)
|
|
26
|
+
async def resource_files(project_root_dir: Path): # noqa: ANN201
|
|
27
|
+
"""Endpoint to fetch all resource files.
|
|
28
|
+
|
|
29
|
+
Arguments:
|
|
30
|
+
project_root_dir (str): The project_root_directory path.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
ResourceFilesResponse: List containing all resource files.
|
|
34
|
+
|
|
35
|
+
"""
|
|
36
|
+
try:
|
|
37
|
+
resource_files_list = []
|
|
38
|
+
directory_parser = DirectoryParser(project_root_dir)
|
|
39
|
+
resource_files = directory_parser.get_resource_file_paths()
|
|
40
|
+
|
|
41
|
+
resource_files_list.extend(SelectionFiles(file_name=file.name, path=file.as_posix()) for file in resource_files)
|
|
42
|
+
|
|
43
|
+
except Exception as e:
|
|
44
|
+
logger.exception("Error fetching resource file names: ")
|
|
45
|
+
raise HTTPException(status_code=500, detail="Internal Server Error") from e
|
|
46
|
+
else:
|
|
47
|
+
return ResourceFilesResponse(resource_files=resource_files_list)
|