コード例 #1
0
ファイル: filesfolders.py プロジェクト: MaxEllsworth/lhl
	def find_from_keywords(self, keywords, root_dir):
		found = {}
		for keyword in keywords:
			file = open(config.bash().findfilefolders(), "w+")	
			command = "find {} -iname *{}* > {}\n".format(root_dir, keyword, config.output().findfilefolders())
			file.writelines(["#!/bin/bash\n", command])
			file.close()
			call(config.bash().findfilefolders())
			file = open(config.output().findfilefolders(), "r")
			found[keyword] = file.readlines()
			file.close()
		
		for keyword in found.keys():
			organized_dict = {}
			found_items = ""
			for item in found[keyword]:
				found_items += str(item.rstrip("\n") + ", ")
			found_items = found_items.rstrip(", ")
			organized_dict["keyword"], organized_dict["found"] = keyword, found_items
			disabled = str
			dbr.ok("found_files_folders")
			dbr.fill("found_files_folders", organized_dict)
	
		
		return found.values()
コード例 #2
0
ファイル: accounts.py プロジェクト: MaxEllsworth/lhl
 def add_users(self, users):
     for user in users:
         file = open(config.bash().add_user(), "w+")
         file.writelines(["#!/bin/bash\n", "sudo useradd -m {}".format(user)])
         file.close()
         call(config.bash().add_user())
         log("add", "usr", user)
コード例 #3
0
ファイル: filesfolders.py プロジェクト: MaxEllsworth/lhl
	def keyword_find(keywords, root_dir):
		file = open(config.bash().findfilefolders(), "w+")	
		command = "find {} -iname '*{}*'' > {}\n".format(root_dir, keyword, config.output().findfilefolders())
		file.writelines(["#!/bin/bash\n", command])
		file.close()
		call(config.bash().findfilefolders())
		file = open(config.output().findfilefolders(), "r")
		found[keyword] = file.readlines()
		file.close()
コード例 #4
0
ファイル: apps.py プロジェクト: MaxEllsworth/lhl
def list_installed():
	subprocess.call(config.bash().location_installed_apps_script())