Skip to content

*: add some API for RPC server #922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions feeluown/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,23 @@ def _write_metadata_if_needed(self, f):
f.write('\n')
f.write(TOML_DELIMLF)

def raw_data(self):
"""Return the raw data of the collection file.

.. versionadded:: 4.1.11
"""
with open(self.fpath, encoding='utf-8') as f:
return f.read()

def overwrite_with_raw_data(self, raw_data):
"""Overwrite the collection file with the provided raw data.

.. versionadded:: 4.1.11
"""
with open(self.fpath, 'w', encoding='utf-8') as f:
f.write(raw_data)
self.load()


class CollectionManager:

Expand Down
2 changes: 1 addition & 1 deletion feeluown/serializers/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def serialize_search_result_list(self, list_):

class SimpleTypeSerializer(PythonSerializer, metaclass=SerializerMeta):
class Meta:
types = (str, int, float, type(None))
types = (str, int, float, type(None), dict)

def serialize(self, object):
return object
Loading