Skip to content

Add remote host variable for DB #14

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 3 commits 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
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/aws.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/zcrm-python-sdk.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

379 changes: 379 additions & 0 deletions zcrmsdk.egg-info/PKG-INFO

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions zcrmsdk.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MANIFEST.in
README.md
setup.cfg
setup.py
zcrmsdk/CLException.py
zcrmsdk/Handler.py
zcrmsdk/OAuthClient.py
zcrmsdk/OAuthUtility.py
zcrmsdk/Operations.py
zcrmsdk/Org.py
zcrmsdk/Path.py
zcrmsdk/Persistence.py
zcrmsdk/Request.py
zcrmsdk/Response.py
zcrmsdk/RestClient.py
zcrmsdk/Test.py
zcrmsdk/Utility.py
zcrmsdk/__init__.py
zcrmsdk.egg-info/PKG-INFO
zcrmsdk.egg-info/SOURCES.txt
zcrmsdk.egg-info/dependency_links.txt
zcrmsdk.egg-info/requires.txt
zcrmsdk.egg-info/top_level.txt
1 change: 1 addition & 0 deletions zcrmsdk.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions zcrmsdk.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requests
1 change: 1 addition & 0 deletions zcrmsdk.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zcrmsdk
4 changes: 3 additions & 1 deletion zcrmsdk/OAuthClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def initialize(config_dict = None):
ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_USERNAME]="root"
if(ZohoOAuthConstants.DATABASE_PASSWORD not in ZohoOAuth.configProperties or ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_PASSWORD]==""):
ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_PASSWORD]=""
if(ZohoOAuthConstants.DATABASE_HOST not in ZohoOAuth.configProperties or ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_HOST]==""):
ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_HOST]="localhost"
oAuthParams=ZohoOAuthParams.get_instance(ZohoOAuth.configProperties[ZohoOAuthConstants.CLIENT_ID], ZohoOAuth.configProperties[ZohoOAuthConstants.CLIENT_SECRET], ZohoOAuth.configProperties[ZohoOAuthConstants.REDIRECT_URL])
ZohoOAuthClient.get_instance(oAuthParams)
except Exception as ex:
Expand All @@ -43,7 +45,7 @@ def initialize(config_dict = None):
def set_config_values(config_dict):
config_keys = [ZohoOAuthConstants.CLIENT_ID, ZohoOAuthConstants.CLIENT_SECRET, ZohoOAuthConstants.REDIRECT_URL, ZohoOAuthConstants.ACCESS_TYPE
, ZohoOAuthConstants.IAM_URL, ZohoOAuthConstants.TOKEN_PERSISTENCE_PATH, ZohoOAuthConstants.DATABASE_PORT
, ZohoOAuthConstants.DATABASE_PASSWORD, ZohoOAuthConstants.DATABASE_USERNAME, ZohoOAuthConstants.CUSTOM_PERSISTENCE_HANDLER_PATH, ZohoOAuthConstants.CUSTOM_PERSISTENCE_HANDLER_CLASS]
, ZohoOAuthConstants.DATABASE_PASSWORD, ZohoOAuthConstants.DATABASE_USERNAME,ZohoOAuthConstants.DATABASE_HOST, ZohoOAuthConstants.CUSTOM_PERSISTENCE_HANDLER_PATH, ZohoOAuthConstants.CUSTOM_PERSISTENCE_HANDLER_CLASS]
if(ZohoOAuthConstants.ACCESS_TYPE not in config_dict or config_dict[ZohoOAuthConstants.ACCESS_TYPE] is None):
ZohoOAuth.configProperties[ZohoOAuthConstants.ACCESS_TYPE] = "offline"
if(ZohoOAuthConstants.IAM_URL not in config_dict or config_dict[ZohoOAuthConstants.IAM_URL] == ""):
Expand Down
1 change: 1 addition & 0 deletions zcrmsdk/OAuthUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class ZohoOAuthConstants(object):
DATABASE_PORT="mysql_port";
DATABASE_PASSWORD="mysql_password";
DATABASE_USERNAME="mysql_username";
DATABASE_HOST="mysql_host";
PERSISTENCE_FILE_NAME="zcrm_oauthtokens.pkl"

GRANT_TYPE_REFRESH="refresh_token";
Expand Down
2 changes: 1 addition & 1 deletion zcrmsdk/Persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def getDBConnection(self):
from OAuthClient import ZohoOAuth
from OAuthUtility import ZohoOAuthConstants
import mysql.connector
connection=mysql.connector.connect(user=ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_USERNAME], password=ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_PASSWORD],port=ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_PORT],database='zohooauth')
connection=mysql.connector.connect(user=ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_USERNAME], password=ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_PASSWORD],port=ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_PORT],host=ZohoOAuth.configProperties[ZohoOAuthConstants.DATABASE_HOST],database='zohooauth')
return connection
#connection=MySQLdb.connect(host="localhost",user="root",passwd="",db="zohooauth")
#return connection
Expand Down