moved basesnippet and paragraph to snippet.py
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
from .scicat import SciCat
|
from .scicat import SciCat
|
||||||
from .scilog import SciLog
|
from .scilog import SciLog
|
||||||
from .scilog import Basesnippet, Paragraph
|
from .snippet import Basesnippet, Paragraph
|
||||||
|
|
||||||
|
@ -3,42 +3,11 @@ from __future__ import annotations
|
|||||||
from .authclient import AuthMixin, AuthError, HEADER_JSON
|
from .authclient import AuthMixin, AuthError, HEADER_JSON
|
||||||
from .mkfilt import make_filter
|
from .mkfilt import make_filter
|
||||||
from .httpclient import HttpClient
|
from .httpclient import HttpClient
|
||||||
from .snippet import Snippet
|
from .snippet import Snippet, Basesnippet
|
||||||
from typing import TypeVar, Union, List, Type, get_type_hints
|
from typing import TypeVar, Union, List, Type, get_type_hints
|
||||||
import functools
|
import functools
|
||||||
|
|
||||||
|
|
||||||
class Basesnippet(Snippet):
|
|
||||||
def __init__(self):
|
|
||||||
super().__init__()
|
|
||||||
self.set_properties(
|
|
||||||
id=str,
|
|
||||||
parentId=str,
|
|
||||||
ownerGroup=str,
|
|
||||||
accessGroups=list,
|
|
||||||
snippetType=str,
|
|
||||||
isPrivate=bool,
|
|
||||||
createdAt=str,
|
|
||||||
createdBy=str,
|
|
||||||
updatedAt=str,
|
|
||||||
updateBy=str,
|
|
||||||
subsnippets=List[type(Basesnippet)],
|
|
||||||
tags=List[str],
|
|
||||||
dashboardName=str,
|
|
||||||
files=str,
|
|
||||||
location=str,
|
|
||||||
defaultOrder=int,
|
|
||||||
linkType=str,
|
|
||||||
versionable=bool,
|
|
||||||
deleted=bool)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Paragraph(Basesnippet):
|
|
||||||
def __init__(self):
|
|
||||||
super().__init__()
|
|
||||||
self.set_properties(textcontent=str, isMessage=str)
|
|
||||||
|
|
||||||
|
|
||||||
class SciLogRestAPI(HttpClient):
|
class SciLogRestAPI(HttpClient):
|
||||||
def __init__(self, url):
|
def __init__(self, url):
|
||||||
|
@ -64,6 +64,36 @@ class Snippet(dict):
|
|||||||
return cls.from_dict(response)
|
return cls.from_dict(response)
|
||||||
|
|
||||||
|
|
||||||
|
class Basesnippet(Snippet):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.set_properties(
|
||||||
|
id=str,
|
||||||
|
parentId=str,
|
||||||
|
ownerGroup=str,
|
||||||
|
accessGroups=list,
|
||||||
|
snippetType=str,
|
||||||
|
isPrivate=bool,
|
||||||
|
createdAt=str,
|
||||||
|
createdBy=str,
|
||||||
|
updatedAt=str,
|
||||||
|
updateBy=str,
|
||||||
|
subsnippets=list,
|
||||||
|
tags=list,
|
||||||
|
dashboardName=str,
|
||||||
|
files=str,
|
||||||
|
location=str,
|
||||||
|
defaultOrder=int,
|
||||||
|
linkType=str,
|
||||||
|
versionable=bool,
|
||||||
|
deleted=bool)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class Paragraph(Basesnippet):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.set_properties(textcontent=str, isMessage=str)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Reference in New Issue
Block a user