Compare commits
No commits in common. "master" and "feature/secrets-portal-migration" have entirely different histories.
master
...
feature/se
@ -105,11 +105,6 @@ po/
|
||||
|
||||
5. **Module Installation**: Python modules are installed to `{datadir}/roster/roster/` and the launcher script is configured with the correct Python interpreter path.
|
||||
|
||||
## Communication
|
||||
|
||||
- Communicate with the user in **English**
|
||||
- Git commit messages: **concise, single-line, in English**
|
||||
|
||||
## Adding New Python Modules
|
||||
|
||||
When adding new `.py` files to `src/`:
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://git.bugsy.cz/beval/roster.git",
|
||||
"tag": "v0.8.3"
|
||||
"tag": "v0.8.2"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -25,11 +25,6 @@
|
||||
<!-- Use the OARS website (https://hughsie.github.io/oars/generate.html) to generate these and make sure to use oars-1.1 -->
|
||||
<content_rating type="oars-1.1" />
|
||||
|
||||
<branding>
|
||||
<color type="primary" scheme_preference="light">#8b9dbc</color>
|
||||
<color type="primary" scheme_preference="dark">#173c7a</color>
|
||||
</branding>
|
||||
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://git.bugsy.cz/beval/roster/raw/branch/master/screenshots/main.png</image>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
project('roster',
|
||||
version: '0.8.3',
|
||||
version: '0.8.2',
|
||||
meson_version: '>= 1.0.0',
|
||||
default_options: [ 'warning_level=2', 'werror=false', ],
|
||||
)
|
||||
|
||||
@ -924,9 +924,6 @@ class RequestTabWidget(Gtk.Box):
|
||||
language = self._get_language_from_content_type(content_type)
|
||||
source_buffer.set_language(language)
|
||||
|
||||
# Switch to body tab
|
||||
self.response_stack.set_visible_child_name("body")
|
||||
|
||||
def display_error(self, error: str) -> None:
|
||||
"""Display error in this tab's UI."""
|
||||
self.status_label.set_text("Error")
|
||||
@ -1153,18 +1150,6 @@ class RequestTabWidget(Gtk.Box):
|
||||
|
||||
return ""
|
||||
|
||||
def _is_json_content_type(self, content_type):
|
||||
"""Check if the content type is JSON or a JSON-based format."""
|
||||
return ('application/json' in content_type
|
||||
or 'text/json' in content_type
|
||||
or '+json' in content_type)
|
||||
|
||||
def _is_xml_content_type(self, content_type):
|
||||
"""Check if the content type is XML or an XML-based format."""
|
||||
return ('application/xml' in content_type
|
||||
or 'text/xml' in content_type
|
||||
or '+xml' in content_type)
|
||||
|
||||
def _get_language_from_content_type(self, content_type):
|
||||
"""Get GtkSourceView language ID from content type."""
|
||||
if not content_type:
|
||||
@ -1172,9 +1157,9 @@ class RequestTabWidget(Gtk.Box):
|
||||
|
||||
language_manager = GtkSource.LanguageManager.get_default()
|
||||
|
||||
if self._is_json_content_type(content_type):
|
||||
if 'application/json' in content_type or 'text/json' in content_type:
|
||||
return language_manager.get_language('json')
|
||||
elif self._is_xml_content_type(content_type):
|
||||
elif 'application/xml' in content_type or 'text/xml' in content_type:
|
||||
return language_manager.get_language('xml')
|
||||
elif 'text/html' in content_type:
|
||||
return language_manager.get_language('html')
|
||||
@ -1191,10 +1176,10 @@ class RequestTabWidget(Gtk.Box):
|
||||
return body
|
||||
|
||||
try:
|
||||
if self._is_json_content_type(content_type):
|
||||
if 'application/json' in content_type or 'text/json' in content_type:
|
||||
parsed = json.loads(body)
|
||||
return json.dumps(parsed, indent=2, ensure_ascii=False)
|
||||
elif self._is_xml_content_type(content_type):
|
||||
elif 'application/xml' in content_type or 'text/xml' in content_type:
|
||||
dom = xml.dom.minidom.parseString(body)
|
||||
return dom.toprettyxml(indent=" ")
|
||||
except Exception as e:
|
||||
|
||||
@ -1183,8 +1183,9 @@ class RosterWindow(Adw.ApplicationWindow):
|
||||
return
|
||||
|
||||
# Apply variable substitution if environment is selected
|
||||
def show_export(env):
|
||||
substituted_request = request
|
||||
substituted_request = request
|
||||
if widget.selected_environment_id:
|
||||
env = widget.get_selected_environment()
|
||||
if env:
|
||||
from .variable_substitution import VariableSubstitution
|
||||
substituted_request, undefined = VariableSubstitution.substitute_request(request, env)
|
||||
@ -1195,15 +1196,10 @@ class RosterWindow(Adw.ApplicationWindow):
|
||||
# Show warning toast but continue with export
|
||||
self._show_toast(f"Warning: {len(undefined)} undefined variable(s)")
|
||||
|
||||
# Show export dialog with substituted request
|
||||
from .export_dialog import ExportDialog
|
||||
dialog = ExportDialog(substituted_request)
|
||||
dialog.present(self)
|
||||
|
||||
if widget.selected_environment_id:
|
||||
widget.get_selected_environment(show_export)
|
||||
else:
|
||||
show_export(None)
|
||||
# Show export dialog with substituted request
|
||||
from .export_dialog import ExportDialog
|
||||
dialog = ExportDialog(substituted_request)
|
||||
dialog.present(self)
|
||||
|
||||
def _mark_tab_as_saved(self, saved_request_id, name, request, scripts=None):
|
||||
"""Mark the current tab as saved (clear modified flag)."""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user