Skip to content

Commit 6c62588

Browse files
shaileshmishrashaileshmishra
authored andcommitted
✨ v1.2.1
1 parent c35d06a commit 6c62588

File tree

7 files changed

+35
-1198
lines changed

7 files changed

+35
-1198
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ If you are using Contentstack Python SDK in your project by running the followin
3131
## For the specific version
3232

3333
```python
34-
pip install Contentstack==1.4.0
34+
pip install Contentstack==1.5.1
3535
```
3636

3737
## Usage
@@ -46,11 +46,9 @@ To render embedded items on the front-end, use the renderContents function, and
4646
from contentstack_utils.utils import Utils
4747
from contentstack_utils.render.options import Options
4848

49-
json_array # should be type of dictionary or list
50-
rte_content = "html_string"
51-
52-
callback = Options()
53-
response = Utils.render_content(rte_content, json_array, callback)
49+
json_array = {} # should be type of dictionary or list
50+
option = Options()
51+
response = Utils.render_content('html_string', json_array, option)
5452
print(response)
5553

5654
```

changelog.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,20 @@
22
**CHANGELOG**
33
================
44

5+
*v1.2.0*
6+
============
7+
8+
NEW FEATURE: GraphQl supercharged RTE
9+
10+
- GQL.jsonToHtml function support added
11+
12+
13+
*v1.1.0*
14+
============
15+
516
NEW FEATURE: Supercharged RTE
617

7-
- jsonToHtml function support added
18+
- Utils.jsonToHtml function support added
819

920
*v0.2.0*
1021
============

contentstack_utils/helper/converter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
def convert_style(style) -> StyleType:
55
if style == 'block':
66
return StyleType.BLOCK
7-
elif style == 'inline':
7+
if style == 'inline':
88
return StyleType.INLINE
9-
elif style == 'link':
9+
if style == 'link':
1010
return StyleType.LINK
11-
elif style == 'display':
11+
if style == 'display':
1212
return StyleType.DISPLAY
13-
elif style == 'download':
13+
if style == 'download':
1414
return StyleType.DOWNLOAD

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
long_description_content_type="text/markdown",
1616
url="https://github.com/contentstack/contentstack-utils-python",
1717
license='MIT',
18-
version='1.1.0',
18+
version='1.2.0',
1919
install_requires=[
2020

2121
],

tests/convert_style.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ def setUp(self):
99
print("logger for ConvertStyle")
1010

1111
def test_converter_style_block(self):
12-
_returns = converter.convert_style("block")
12+
_returns = converter.convert_style('block')
1313
self.assertEquals(StyleType.BLOCK, _returns)
1414

1515
def test_converter_style_inline(self):
16-
_returns = converter.convert_style("inline")
16+
_returns = converter.convert_style('inline')
1717
self.assertEqual(StyleType.INLINE, _returns)
1818

1919
def test_converter_style_link(self):
20-
_returns = converter.convert_style("link")
20+
_returns = converter.convert_style('link')
2121
self.assertEqual(StyleType.LINK, _returns)
2222

2323
def test_converter_style_display(self):
24-
_returns = converter.convert_style("display")
24+
_returns = converter.convert_style('display')
2525
self.assertEqual(StyleType.DISPLAY, _returns)
2626

2727
def test_converter_style_download(self):
28-
_returns = converter.convert_style("download")
28+
_returns = converter.convert_style('download')
2929
self.assertEqual(StyleType.DOWNLOAD, _returns)

tests/test-report/Python-Utils Test Report.html

Lines changed: 0 additions & 1181 deletions
This file was deleted.

tests/test_gql_to_html_func.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,19 @@ def mock_entry():
1515

1616

1717
class TestGQLToHtml(unittest.TestCase):
18+
srt_zero = '<p></p><div><p>Abcd Three</p><div><p>Content type: <span></span></p></div>'
1819

1920
def setUp(self):
2021
print("logger for convert style")
2122

23+
def test_read_entry(self):
24+
entry = mock_entry()
25+
self.assertIsNotNone(entry)
26+
27+
def test_read_entry_uid(self):
28+
entry = mock_entry()
29+
self.assertEqual('sameple_uid', entry['srte']['json'][0]['uid'])
30+
2231
def test_gql_to_html(self):
2332
entry = mock_entry()
2433
option = Options()

0 commit comments

Comments
 (0)