hide db secrets
This commit is contained in:
parent
b64efee4d5
commit
1c2d23e1dd
|
@ -10,10 +10,20 @@ from datetime import datetime
|
||||||
|
|
||||||
cerca = "altura"
|
cerca = "altura"
|
||||||
|
|
||||||
|
# init params
|
||||||
|
def getParams():
|
||||||
|
with open('params.yml', 'r') as params_file:
|
||||||
|
try:
|
||||||
|
return yaml.safe_load(params_file)
|
||||||
|
except yaml.YAMLError as error:
|
||||||
|
print(error)
|
||||||
|
|
||||||
|
params = getParams()
|
||||||
|
|
||||||
cnx = mysql.connector.connect(
|
cnx = mysql.connector.connect(
|
||||||
user='root', password='1234',
|
user=params['db_user'], password=params['db_password'],
|
||||||
host='192.168.1.22', port=33066,
|
host=params['db_host'], port=params['db_port'],
|
||||||
database='departiculares_spider'
|
database=params['db_name']
|
||||||
)
|
)
|
||||||
|
|
||||||
class Anunci:
|
class Anunci:
|
||||||
|
|
|
@ -4,10 +4,20 @@ import webbrowser
|
||||||
|
|
||||||
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
|
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
|
||||||
|
|
||||||
|
# init params
|
||||||
|
def getParams():
|
||||||
|
with open('params.yml', 'r') as params_file:
|
||||||
|
try:
|
||||||
|
return yaml.safe_load(params_file)
|
||||||
|
except yaml.YAMLError as error:
|
||||||
|
print(error)
|
||||||
|
|
||||||
|
params = getParams()
|
||||||
|
|
||||||
cnx = mysql.connector.connect(
|
cnx = mysql.connector.connect(
|
||||||
user='root', password='1234',
|
user=params['db_user'], password=params['db_password'],
|
||||||
host='192.168.1.22', port=33066,
|
host=params['db_host'], port=params['db_port'],
|
||||||
database='departiculares_spider'
|
database=params['db_name']
|
||||||
)
|
)
|
||||||
|
|
||||||
c1 = cnx.cursor()
|
c1 = cnx.cursor()
|
||||||
|
|
|
@ -4,10 +4,20 @@ import webbrowser
|
||||||
|
|
||||||
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
|
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
|
||||||
|
|
||||||
|
# init params
|
||||||
|
def getParams():
|
||||||
|
with open('params.yml', 'r') as params_file:
|
||||||
|
try:
|
||||||
|
return yaml.safe_load(params_file)
|
||||||
|
except yaml.YAMLError as error:
|
||||||
|
print(error)
|
||||||
|
|
||||||
|
params = getParams()
|
||||||
|
|
||||||
cnx = mysql.connector.connect(
|
cnx = mysql.connector.connect(
|
||||||
user='root', password='1234',
|
user=params['db_user'], password=params['db_password'],
|
||||||
host='192.168.1.22', port=33066,
|
host=params['db_host'], port=params['db_port'],
|
||||||
database='departiculares_spider'
|
database=params['db_name']
|
||||||
)
|
)
|
||||||
|
|
||||||
c1 = cnx.cursor()
|
c1 = cnx.cursor()
|
||||||
|
|
|
@ -3,10 +3,20 @@ from datetime import datetime
|
||||||
|
|
||||||
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
|
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
|
||||||
|
|
||||||
|
# init params
|
||||||
|
def getParams():
|
||||||
|
with open('params.yml', 'r') as params_file:
|
||||||
|
try:
|
||||||
|
return yaml.safe_load(params_file)
|
||||||
|
except yaml.YAMLError as error:
|
||||||
|
print(error)
|
||||||
|
|
||||||
|
params = getParams()
|
||||||
|
|
||||||
cnx = mysql.connector.connect(
|
cnx = mysql.connector.connect(
|
||||||
user='root', password='1234',
|
user=params['db_user'], password=params['db_password'],
|
||||||
host='192.168.1.22', port=33066,
|
host=params['db_host'], port=params['db_port'],
|
||||||
database='departiculares_spider'
|
database=params['db_name']
|
||||||
)
|
)
|
||||||
|
|
||||||
c1 = cnx.cursor()
|
c1 = cnx.cursor()
|
||||||
|
|
|
@ -4,10 +4,20 @@ import webbrowser
|
||||||
|
|
||||||
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
|
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
|
||||||
|
|
||||||
|
# init params
|
||||||
|
def getParams():
|
||||||
|
with open('params.yml', 'r') as params_file:
|
||||||
|
try:
|
||||||
|
return yaml.safe_load(params_file)
|
||||||
|
except yaml.YAMLError as error:
|
||||||
|
print(error)
|
||||||
|
|
||||||
|
params = getParams()
|
||||||
|
|
||||||
cnx = mysql.connector.connect(
|
cnx = mysql.connector.connect(
|
||||||
user='root', password='1234',
|
user=params['db_user'], password=params['db_password'],
|
||||||
host='192.168.1.22', port=33066,
|
host=params['db_host'], port=params['db_port'],
|
||||||
database='departiculares_spider'
|
database=params['db_name']
|
||||||
)
|
)
|
||||||
|
|
||||||
c1 = cnx.cursor()
|
c1 = cnx.cursor()
|
||||||
|
|
Loading…
Reference in New Issue