当前位置: 首页>>代码示例>>Python>>正文


Python Helpers.Helpers类代码示例

本文整理汇总了Python中Helpers.Helpers的典型用法代码示例。如果您正苦于以下问题:Python Helpers类的具体用法?Python Helpers怎么用?Python Helpers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Helpers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TemplatePrint

 def TemplatePrint(self, Task):
     '''
     This function will print 
     to the console the output of the email.
     '''
     try:
         EmailRender = Task.Render()
         RenderName = Task.RenderName
         with open(RenderName, "w+") as myfile:
             myfile.write(EmailRender)
         try:
             # time.sleep(0)
             temp = "\n"
             temp += subprocess.check_output(["w3m",
                                              "-dump", "-T", "text/html", RenderName])
             print Helpers.Reindent(temp, 1)
             # time.sleep(5)
         except Exception as e:
             print Helpers.color(" [!] Is w3m installed (run Setup.sh)?")
             print e
         # now remove temp file
         # time.sleep(2)
         os.remove(RenderName)
     except Exception as e:
         print e
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:25,代码来源:TaskController.py

示例2: TemplateRender

 def TemplateRender(self, Task):
     '''
     This function will return the location output
     This will default to the ~/Desktop/ folder
     '''
     try:
         EmailRender = Task.Render()
         # print EmailRender
         RenderName = Task.RenderName
         with open(RenderName, "w+") as myfile:
             myfile.write(EmailRender)
         try:
             # time.sleep(0)
             if ".eml" in RenderName:
                 subprocess.check_call(["icedove", RenderName])
             else:
                 temp = subprocess.check_call(["iceweasel", RenderName])
             # time.sleep(5)
         except Exception as e:
             print Helpers.color(" [!] Is a default browser installed?")
         # now remove temp file
         # time.sleep(2)
         os.remove(RenderName)
     except Exception as e:
         print e
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:25,代码来源:TaskController.py

示例3: TemplateCompleteScreen

 def TemplateCompleteScreen(self, Task, FileLocation, FileName, ModuleInt):
     '''
     Function takes in output data and presents it to user.
     '''
     self.TitleScreen()
     p = " [*] Email Template Generation has been completed:\n"
     line = """{0}
        Task Performed:\t\t{1}
        File Location: \t\t{2}
        Email File:\t\t\t{3}
     """.format(Helpers.color(p, green=True), Task.Name, FileLocation, FileName)
     print line
     # Now check if they want to open the file
     p = Helpers.color(
         " [>] ", status=True) + "Would you like to view the generated template? (y) or (n): "
     while True:
         a = raw_input(p)
         if a.lower() == "y":
             self.TemplateFinalRender(FileLocation, FileName, Task)
             break
         if a.lower() == "n":
             break
     p = Helpers.color(
         " [>] ", status=True) + "Would you like to return to Current Module? (y) or (n): "
     while True:
         a = raw_input(p)
         if a.lower() == "y":
             self.TemplateMenu(Task, ModuleInt)
             break
         if a.lower() == "n":
             self.TaskSelector()
     print line
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:32,代码来源:TaskController.py

示例4: __init__

    def __init__(self, *args, **kwds):
        WxHelpers.__init__(self)
        Helpers.__init__(self)
        # begin wxGlade: CalcFeeDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.l_validfromdate = wx.StaticText(self, -1, _("Ruling valid from"))
        self.validfromdate = wx.DatePickerCtrl(self, -1)
        self.l_receiver = wx.StaticText(self, -1, _("Receiver"))
        self.receiver = wx.TextCtrl(self, -1, "", style=wx.TE_PROCESS_TAB | wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH)
        self.l_income = wx.StaticText(self, -1, _("Underlying income"))
        self.l_calcfee = wx.StaticText(self, -1, _("Individual calculation"))
        self.l_notes = wx.StaticText(self, -1, _("Notes"))
        self.notes = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE)
        self.b_ok = wx.Button(self, wx.ID_OK, "")
        self.b_cancel = wx.Button(self, wx.ID_CANCEL, "")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.OnOK, self.b_ok)
        # end wxGlade

        self.olv_income = olv(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
        self.__initOLVIncome()
        self.olv_calcfee = olv(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
        self.__initOLVCalcFee()
        self.__do_layout_noglade()
        
        pub.subscribe(self.Populate, 'dialog.calcfee.populate') #@UndefinedVariable
开发者ID:oliverbienert,项目名称:monte-helper,代码行数:30,代码来源:CalcFeeDialog.py

示例5: TemplateView

 def TemplateView(self, Task):
     FileName = Task.SampleImage
     try:
         subprocess.check_call(["xdg-open", FileName])
     except Exception as e:
         s = "status 4"
         if s in str(e):
             print Helpers.color(" [!] Sorry no image submitted yet!")
         else:
             print Helpers.color(" [!] Is a default image viewer installed?")
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:10,代码来源:TaskController.py

示例6: TitleScreen

 def TitleScreen(self):
     os.system('clear')
     # stolen from Veil :)
     p = "[Twitter]"
     w = "[Web]"
     print " ============================================================"
     print " Current: " + self.version + " | SimplyTemplate | " + Helpers.color(w, status=True) + ": CyberSyndicates.com"
     print " ============================================================"
     print "   " + Helpers.color(p, status=True) + ": @CyberSyndicates  | " + Helpers.color(p, status=True) + ": @Killswitch_gui"
     print " ============================================================"
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:10,代码来源:TaskController.py

示例7: Template_Info

 def Template_Info(self, Task):
     try:
         self.TitleScreen()
         print Helpers.color("\n Template Information:\n", status=True)
         for item in self.TemplateInfo:
             task = "Task." + str(item.rstrip(":"))
             if task == "Task.Sophistication":
                 if eval(task).lower() == "high":
                     print "\t" + item + "\t\t" + Helpers.color(eval(task), green=True)
                 if eval(task).lower() == "medium":
                     print "\t" + item + "\t\t" + Helpers.color(eval(task), firewall=True)
                 if eval(task).lower() == "low":
                     print "\t" + item + "\t\t" + Helpers.color(eval(task), warning=True)
             elif task == "Task.SampleImage":
                 print "\t" + item + "\t\t" + eval(task)
             elif task == "Task.Info":
                 print Helpers.FormatLong("Info:", Task.Info, spacing=24)
             else:
                 print "\t" + item + "\t\t\t" + eval(task)
         # https://github.com/Veil-Framework/Veil-Evasion/blob/master/modules/common/controller.py
         # Taken from line 246
         print Helpers.color("\n Template Required Options:\n", status=True)
         print " Setting\t\tValue Set\t\t\tDescription of Setting"
         print " -------\t\t---------\t\t\t----------------------"
         for key in sorted(Task.RequiredOptions.iterkeys()):
             print " %s%s%s" % ('{0: <16}'.format(key).ljust(23), '{0: <8}'.format(Task.RequiredOptions[key][0]).ljust(32), Task.RequiredOptions[key][1])
     except Exception as e:
         print e
         p = " [!] Please select a valid Module number\n"
         print Helpers.color(p, firewall=True)
         return
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:31,代码来源:TaskController.py

示例8: ModuleSelection

 def ModuleSelection(self, selection):
     ModuleInt = int(selection[1])
     try:
         SelectedModule = self.Dmodules[ModuleInt]
         Task = SelectedModule.TemplateModule()
         return Task
     except Exception as e:
         print e
         p = " [!] Please select a valid Module number"
         print Helpers.color(p, firewall=True)
         return
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:11,代码来源:TaskController.py

示例9: __init__

 def __init__(self):
     '''
     Constructor
     '''
     Helpers.__init__(self)
     self.adult = defaultdict(dict)
     self.child = defaultdict(dict)
     self.totalincome = 0
     self.lenAdults = 0
     self.hhsize = 0
     self.reduction2 = 0
     self.payer = None
开发者ID:oliverbienert,项目名称:monte-helper,代码行数:12,代码来源:Calcfee.py

示例10: TemplateGen

 def TemplateGen(self, Task, ModuleInt):
     '''
     This Function takes in the template Task Object
     It will run the pre-defined Class Call
     '''
     try:
         FileLocation = self.TemplateLocation()
         Name = self.TemplateName(Task)
         Task.Generate(FileLocation, Name, Verbose=False)
         self.TemplateCompleteScreen(Task, FileLocation, Name, ModuleInt)
     except Exception as e:
         p = " [!] Major issue with template gen: " + str(e)
         print Helpers.color(p, warning=True)
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:13,代码来源:TaskController.py

示例11: TemplateMenu

    def TemplateMenu(self, Task, ModuleInt):

        # start with Template menu and printing out the modules
        self.TitleScreen()
        p = "\n Template Loaded: " + Helpers.color(Task.Name, status=True)
        print p + "\n\n"
        self.TemplateRequiredOptions(Task)
        self.ModuleCommands()
        # setup module commands and required lists
        cmddict = self.TemplateCmdLoopCommands(Task)
        # now call cmd loop
        CmdLoop.start_loop(cmddict)
        while True:
            try:
                a = CmdLoop.input_loop()
                # a = raw_input(Helpers.color(p,status=True))
                if a.startswith("set") or a.startswith("s"):
                    try:
                        Split = Helpers.GetWords(a)
                        if Split[0].lower() == "set" or Split[0].lower() == "s":
                            self.TemplateSet(Task, Split, a)
                    except Exception as e:
                        print e
                        print Helpers.color(" [!] You must use [set] with Value", firewall=True)
                if a.startswith("edit") or a.startswith("e"):
                    try:
                        Split = Helpers.GetWords(a)
                        if Split[0].lower() == "edit" or Split[0].lower() == "e":
                            self.TemplateEdit(Task, Split, a)
                    except Exception as e:
                        print Helpers.color(" [!] You must use [edit] with Value", firewall=True)
                if a.lower() == "gen" or a.lower() == "g" or a.lower() == "run":
                    self.TemplateGen(Task, ModuleInt)
                if a.lower() == "info" or a.lower() == "i":
                    self.Template_Info(Task)
                if a.lower() == "view" or a.lower() == "v":
                    self.TemplateView(Task)
                if a.lower() == "print" or a.lower() == "p":
                    self.TemplatePrint(Task)
                if a.lower() == "render" or a.lower() == "r":
                    self.TemplateRender(Task)
                if a.lower() == "back" or a.lower() == "b":
                    self.TaskSelector()
                if a.lower() == "help" or a.lower() == "h" or a.lower() == "?":
                    self.ModuleHelp()
                if a.lower() == "exit":
                    Helpers.Exit()
            except Exception as e:
                print a
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:49,代码来源:TaskController.py

示例12: TemplateSet

    def TemplateSet(self, Task, Value, Raw):
        try:
            option = Value[1]
            if Value[1] not in Task.RequiredOptions:
                print Helpers.color(" [!] Invalid option specified.", firewall=True)

            else:
                Raw = Raw.strip(Value[0])
                Raw = Raw.lstrip(' ')
                Raw = Raw.lstrip(Value[1])
                Raw = Raw.lstrip(' ')
                Task.RequiredOptions[option][0] = Raw
                return
        except Exception as e:
            print e
            print Helpers.color(" [!] Error in setting option, likely invalid option name.", firewall=True)
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:16,代码来源:TaskController.py

示例13: __init__

	def __init__(self,PageHeap=False):
		print( '[+] '+ datetime.now().strftime("%Y:%m:%d::%H:%M:%S") +' Using Win32Com for fuzzing')
		self.ph = PageHeap
		self.help = Helpers()
		self.iePiD_p = None
		self.iePid_c = None
		self.StartUpPage = 'file://'+os.getcwd().replace('\\','/')+'\\Start.html'.replace('\\','/')
开发者ID:akibsayyed,项目名称:IEFuzz,代码行数:7,代码来源:IECom.py

示例14: ModuleRequiredOptions

 def ModuleRequiredOptions(self, selection):
     ModuleInt = int(selection[1])
     try:
         SelectedModule = self.Dmodules[ModuleInt]
         Task = SelectedModule.TemplateModule()
         # https://github.com/Veil-Framework/Veil-Evasion/blob/master/modules/common/controller.py
         # Taken from line 246
         print Helpers.color("\n Template Required Options:\n", status=True)
         print " Setting\t\tValue Set\t\tDescription of Setting"
         print " -------\t\t---------\t\t----------------------"
         for key in sorted(Task.RequiredOptions.iterkeys()):
             print " %s%s%s" % ('{0: <16}'.format(key).ljust(10), '{0: <8}'.format(Task.RequiredOptions[key][0]).ljust(30), Task.RequiredOptions[key][1])
     except Exception as e:
         print e
         p = " [!] Please select a valid Module number\n"
         print Helpers.color(p, firewall=True)
         return
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:17,代码来源:TaskController.py

示例15: TemplateFinalRender

 def TemplateFinalRender(self, FilePath, FileName, Task):
     '''
     This function will open the 
     Produced .MHT file
     '''
     try:
         # print EmailRender
         Path = str(FilePath) + str(FileName)
         try:
             time.sleep(1)
             if ".eml" in Path:
                 subprocess.check_call(["icedove", "-File", Path])
             else:
                 subprocess.check_call(["iceweasel", Path])
             # time.sleep(5)
         except Exception as e:
             print Helpers.color(" [!] Is a Iceweasel browser installed? (Run Setup)")
     except Exception as e:
         print e
开发者ID:n03lx,项目名称:SimplyTemplate,代码行数:19,代码来源:TaskController.py


注:本文中的Helpers.Helpers类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。