Skip to content

Commit 2833997

Browse files
entry refactored
1 parent 07be083 commit 2833997

File tree

5 files changed

+26
-36
lines changed

5 files changed

+26
-36
lines changed

CHANGELOGS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
## v1.0.0
2+
## v 0.0.1
33
Initial release of the python Content Delivery API SDK.

contentstack/__init__.py

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,10 @@
1-
# -*- coding: utf-8 -*-
2-
3-
# __init__.py
4-
# Contentstack
5-
# Created by Shailesh on 22/06/19.
6-
# Copyright (c) 2012 - 2019 Contentstack. All rights reserved.
7-
8-
# [MIT License] :: Permission is hereby granted, free of charge, to any person
9-
# obtaining a copy of this software and associated documentation files (the "Software"),
10-
# to deal in the Software without restriction, including without limitation the rights
11-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12-
# copies of the Software, and to permit persons to whom the Software is
13-
# furnished to do so, subject to the following conditions:
14-
15-
# The above copyright notice and this permission notice shall be included in all
16-
# copies or substantial portions of the Software.
17-
18-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24-
# SOFTWARE.
1+
""" contentstack python sdk. """
2+
3+
__author__ = 'Shailesh Mishra'
4+
__status__ = 'debug'
5+
__version__ = '1.0.0'
6+
__package__ = 'contentstack'
7+
__endpoint__ = 'cdn.contentstack.io'
258

269
# from .stack import Stack
2710
from .entry import Entry
@@ -34,10 +17,17 @@
3417
from .group import Group
3518
from .http_request import HTTPRequestConnection
3619

37-
__author__ = "Shailesh Mishra <mshaileshr@gmail.com>"
38-
__status__ = "debug"
39-
__date__ = "01 July 2019"
40-
__version__ = "1.0.0"
41-
__package__ = "contentstack.python"
42-
__endpoint__ = "cdn.contentstack.io"
20+
21+
# Set a default logger to prevent "No handler found" warnings
22+
import logging
23+
try: # Python >=2.7
24+
from logging import NullHandler
25+
except ImportError:
26+
class NullHandler(logging.Handler):
27+
def emit(self, record):
28+
pass
29+
30+
logging.getLogger(__name__).addHandler(NullHandler())
31+
32+
4333

contentstack/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self):
3636
"stacks": "stacks",
3737
"sync": "stacks/sync",
3838
"content_types": "content_types",
39-
"entries": "entries",
39+
"entries": "content_types",
4040
"assets": "assets",
4141
"environments": "environments"
4242
})
@@ -73,6 +73,6 @@ def endpoint(self, path):
7373

7474
config = Config()
7575
config.host("cdn.contentstack.io")
76-
result_url = config.endpoint('assets')
76+
result_url = config.endpoint('entries')
7777
print(result_url)
7878

contentstack/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class NullHandler(logging.Handler):
3232
def emit(self, record):
3333
pass
3434

35-
logging.basicConfig(filename='contentstack.log', format='%(asctime)s - %(message)s', level=logging.INFO)
36-
logging.getLogger("Config")
35+
#logging.basicConfig(filename='contentstack.log', format='%(asctime)s - %(message)s', level=logging.INFO)
36+
#logging.getLogger("Config")
3737

3838

3939
class Util:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "contentstack.python",
3-
"version": "1.0.0",
3+
"version": "0.0.1",
44
"dependencies": {
55

66
}

0 commit comments

Comments
 (0)