Skip to content

Commit

Permalink
Merge pull request #13 from chavarera/master
Browse files Browse the repository at this point in the history
Syncing
  • Loading branch information
RoyalEagle73 authored Dec 24, 2019
2 parents b5bac07 + 790129f commit 9b1839a
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 19 deletions.
Binary file removed lib/linux/__pycache__/get_browsers.cpython-37.pyc
Binary file not shown.
Binary file removed lib/linux/__pycache__/get_drives.cpython-37.pyc
Binary file not shown.
Binary file removed lib/linux/__pycache__/get_hw_info.cpython-37.pyc
Binary file not shown.
Binary file not shown.
Binary file removed lib/linux/__pycache__/get_os_info.cpython-37.pyc
Binary file not shown.
Binary file not shown.
Binary file removed lib/linux/__pycache__/get_ports.cpython-37.pyc
Binary file not shown.
Binary file not shown.
Binary file removed lib/linux/__pycache__/list_files.cpython-37.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/windows/HardwareInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def getHardwareinfo(self):
Return bios,cpu,usb information
'''
hardwarinfo={
'usb':self.usbPortInfo()
'usb':[self.usbPortInfo()]
}
Hardware_parameter=['onboarddevice','bios','cpu','BASEBOARD','CSPRODUCT','PORTCONNECTOR','SYSTEMSLOT']
for part in Hardware_parameter:
Expand Down
9 changes: 5 additions & 4 deletions lib/windows/NetworkInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ def networkinfo(self):
objectName.networkinfo()
'''
network_info={}
network_info['ip']=self.getIpConfig()
network_info['HostNodeName']=self.getNetworkName()
network_info['IpAddress']=self.getIpAddress()
network_info['MacAddress']=self.getMacAddress()
ipandmacAddress={}
ipandmacAddress['HostNodeName']=self.getNetworkName()
ipandmacAddress['IpAddress']=self.getIpAddress()
ipandmacAddress['MacAddress']=self.getMacAddress()
network_info['ipandmacAddress']=[ipandmacAddress]
network_categories=['netclient','NETPROTOCOL','nic','RDNIC','NICCONFIG']
for part in network_categories:
network_info[part]=self.Preprocess(part)
Expand Down
11 changes: 8 additions & 3 deletions lib/windows/SoftwareInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def getSoftwareList(self):
Get All installed Softwae in th list format with name,version,publisher
'''
try:
return self.getReg_keys(reg.KEY_WOW64_32KEY)+self.getReg_keys(reg.KEY_WOW64_64KEY)
all_installed_apps={}
all_installed_apps["installedPrograms"]=self.getReg_keys(reg.KEY_WOW64_32KEY)+(self.getReg_keys(reg.KEY_WOW64_64KEY))
all_installed_apps["WebBrowsers"]=self.GetInstalledBrowsers()
return all_installed_apps
except Exception as ex:
return ex

Expand All @@ -68,13 +71,15 @@ def GetInstalledBrowsers(self):
Regkey = reg.ConnectRegistry(None, Hkeys)
key = reg.OpenKey(Regkey, path,0, reg.KEY_READ | reg.KEY_WOW64_32KEY)
key_count = reg.QueryInfoKey(key)[0]
browser={}
browser_list=[]
for i in range(key_count):
singsoft={}
try:
keyname=reg.EnumKey(key, i)
browser_list.append(keyname)
singsoft['id']=i
singsoft['Name']=keyname
browser_list.append(singsoft)
except Exception as ex:
continue
return browser_list

2 changes: 1 addition & 1 deletion lib/windows/StorageInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def getStorageinfo(self):
sinfo['Ram']=self.getRamSize()
sinfo['DiskSize']=self.getDiskSize()

storage_catgories=['memoryphiscial','logicaldisk','CDROM','DEVICEMEMORYADDRESS','DISKDRIVE','DISKQUOTA','DMACHANNEL','LOGICALDISK','MEMCACHE','MEMORYCHIP','MEMPHYSICAL','PAGEFILE','PARTITION','VOLUME']
storage_catgories=['logicaldisk','CDROM','DEVICEMEMORYADDRESS','DISKDRIVE','DISKQUOTA','DMACHANNEL','LOGICALDISK','MEMCACHE','MEMORYCHIP','MEMPHYSICAL','PAGEFILE','PARTITION','VOLUME']
for part in storage_catgories:
sinfo[part]=self.Preprocess(part)
return sinfo
Expand Down
6 changes: 4 additions & 2 deletions lib/windows/SystemInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ class this method
names=platform_name[idx]
system_data[names]=value
system_categories=['OS','TIMEZONE','BOOTCONFIG','COMPUTERSYSTEM','STARTUP']
Final_result={}
Final_result['SystemData']=[system_data]
for part in system_categories:
system_data[part]=self.Preprocess(part)
return system_data
Final_result[part]=self.Preprocess(part)
return Final_result

18 changes: 10 additions & 8 deletions lib/windows/common/Utility.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
import json

def CsvTextToDict(text):
lines = text.strip().splitlines()
Expand All @@ -12,11 +13,12 @@ def CsvTextToDict(text):
def ExportTOJson(data):
timestr = time.strftime("%Y%m%d-%H%M%S")
filename=f'output/{timestr}.json'
with open(filename,'wt') as file:
file.write(data)
print(f"Successfully Exported Result in to {filename} file")

## key,value = [line.split(',') for line in lines if len(line)>0]
## final_dict = dict(zip(key,value))
## clean_dict = {key:value for key,value in final_dict.items() if value!=""}

try:
with open(filename, 'w') as fp:
json.dump(data,fp)
return True,f"successfully saved fille in {filename}"
except Exception as ex:
return False,ex



0 comments on commit 9b1839a

Please sign in to comment.