def export_rules(self):
     rules = self.rules_widget.rules
     if not rules:
         return error_dialog(self, _('No rules'), _(
             'There are no rules to export'), show=True)
     path = choose_save_file(self, 'export-style-transform-rules', _('Choose file for exported rules'), initial_filename='rules.txt')
     if path:
         raw = export_rules(rules)
         with open(path, 'wb') as f:
             f.write(raw)
 def export_rules(self):
     rules = self.rules_widget.rules
     if not rules:
         return error_dialog(self, _('No rules'), _(
             'There are no rules to export'), show=True)
     path = choose_save_file(self, 'export-style-transform-rules', _('Choose file for exported rules'), initial_filename='rules.txt')
     if path:
         raw = export_rules(rules)
         with open(path, 'wb') as f:
             f.write(raw)