Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
m41nt41n3r authored Feb 17, 2018
1 parent 8e74c9f commit e85f055
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Windows/lazagne/softwares/databases/postgresql.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
from lazagne.config.write_output import print_debug
from lazagne.config.moduleInfo import ModuleInfo
from lazagne.config.constant import *
import os

class PostgreSQL(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='postgresql', category='databases')

def run(self, software_name=None):
path = os.path.join(constant.profile['APPDATA'], u'postgresql', u'pgpass.conf')
if os.path.exists(path):
with open(path) as f:
data = f.readlines()

pwdFound = []
for line in data:
try:
items = line.strip().split(':')

values = {}
values['Hostname'] = items[0]
values['Port'] = items[1]
values['DB'] = items[2]
values['Username'] = items[3]
values['Password'] = items[4]

pwdFound.append(values)

except:
pass

return pwdFound

0 comments on commit e85f055

Please sign in to comment.