示例#1
0
    def __init__(self):        
        Command.__init__(self, {
            "encrypt": self.__encrypt,
            "decrypt": self.__decrypt
        })

        self.cipher = VigenereCipher()
示例#2
0
    def __init__(self, tk_root):
        '''
        (DateAsker, Tk) -> None

        Initialize the DateAsker; asks user for a date they would like to
        upload for
        '''
        # Initialize an output queue and status
        Command.__init__(self)
        # What we want to do is to make a top level so that we can pop up
        self._toplevel = Toplevel(tk_root)
        todays_year = int(datetime.datetime.today().strftime('%Y'))
        todays_month = int(datetime.datetime.today().strftime('%m'))
        # what we would like to do now is to set a default month and year
        default_year = str(todays_year)
        default_month = self.MONTHS[todays_month]
        # and we want a dropdown, so we make a couple string vars
        self._default_year = StringVar()
        self._default_month = StringVar()
        self._default_year.set(default_year)
        self._default_month.set(default_month)
        # now we want to generate a range for dropdown values
        self._dropdown_year = [i for i in range(todays_year, 1950, -1)]
        self._dropdown_month = list(self.MONTHS.values())
        # create defaults prior to submit
        self._submit_flag = False
        self._submit_month = ''
        self._submit_year = ''
        # now run selection
        self._run_selection()
示例#3
0
	def __init__(self):
		tree=[] #this command needs two levels, base and a yes/no
		base=Node(['weather','forecast'],self.base)
		affirmFull=Node(['yes','ok'],self.affirmFull)
		daffirmFull=Node(['no'],self.daffirmFull)
		tree=[[base],[affirmFull,daffirmFull]]
		Command.__init__(self,tree)
示例#4
0
        def __init__(self, address, command, identity_file=None, login_name=None, callback=None, pty=False):
            self.address = address
            self.command = command
            self.callback = callback

            argv = self.argv(identity_file, login_name, pty, address, command)
            Command.__init__(self, argv, pty=pty, setpgrp=True)
示例#5
0
文件: purgue.py 项目: Aborres/tfc
 def __init__(self):
     Command.__init__(self)
     self.commands_function["-db"] = self.dataBase
     self.commands_function["-database"] = self.dataBase
     self.commands_function["-s"] = self.server
     self.commands_function["-server"] = self.server
     self.commands_function["-l"] = self.local
     self.commands_function["-local"] = self.local
示例#6
0
文件: purgue.py 项目: Aborres/tfc
 def __init__(self):
   Command.__init__(self)
   self.commands_function["-db"] = self.dataBase
   self.commands_function["-database"] = self.dataBase
   self.commands_function["-s"] = self.server
   self.commands_function["-server"] = self.server
   self.commands_function["-l"] = self.local
   self.commands_function["-local"] = self.local
示例#7
0
    def __init__(self):        
        Command.__init__(self, {
            "encrypt": self.__encrypt,
            "decrypt": self.__decrypt,
            "brute_force": self.__brute_force
        })

        self.cipher = CaesarCipher()
示例#8
0
    def __init__(self, address, command):
        opts = ('StrictHostKeyChecking=no', 'PasswordAuthentication=no')

        argv = ['ssh', '-t']
        for opt in opts:
            argv += ["-o", opt]

        argv += [address, command]
        Command.__init__(self, argv, setpgrp=True)
示例#9
0
 def __init__(self, index, zoneType, owner):
     """ Initialize the Buy Card Command """
     self.owner = owner
     self.cardFinder = IndexInZone(index, zoneType)
     Command.__init__(self, [
         CurrentPlayer(),
         NoRequest(), self.cardFinder,
         EnoughPower(self.cardFinder)
     ])
示例#10
0
    def __init__(self, df):
        '''
        (DuplicateRowChecker, DataFrame) -> None

        Initializes a DuplicateRowChecker.
        '''
        Command.__init__(self)
        # set our dataframe
        self._df = df
示例#11
0
    def __init__(self, server, enable=True):
        Command.__init__(self)

        self.dirty = True
        self.enable = enable
        self.server = server

        self.projects = list()
        self.ssh = FileUtils.find_execute('ssh')
    def __init__(self):
        Command.__init__(self)
        self.lock_rx_car_state = threading.Lock()
        self.car_state_data = CarState()
        self.Subscriber("car_state", CarState, self.rx_car_state)
        self.car_scanner_successful = False

        param = AreaParam()
        self.pose_in_map = param.pose_in_map
示例#13
0
文件: joke.py 项目: Alenan/XMPPBot
    def __init__(self, *args, **kwargs):
        Command.__init__(self, *args, **kwargs)

        # read joke files
        self.jokes = {}
        for filename in glob('witze/*'):
            with open(filename) as f:
                self.jokes[basename(filename)] = f.read().splitlines()
        self.jokes[''] = sum(self.jokes.values(), [])
示例#14
0
    def __init__(self, template_name):
        '''
        (UploadingCommand, str) -> None

        Initializes an uploading command, and injects a specific template
        name to the uploading command
        '''
        Command.__init__(self)
        self._template_name = template_name
示例#15
0
    def __init__(self):
        Command.__init__(self, self.__generate)

        self.wine = "wine"
        self.mklnk = "".join([os.getcwd(), "/bin/mklnk.exe"])
        self.uac_bypass_src = "".join([os.getcwd(), "/vbs/uac_bypass.vbs"])
        self.workspace = "/tmp/lnk2pwn/"
        self.default_lnk_file = "lnk2pwn.lnk"
        self.window_styles = ("NORMAL", "MAXIMIZED", "MINIMIZED")
示例#16
0
    def __init__(self, name, explanation):
        """
        Initializes quit command.

        @param name:          The name of the command.
        @param explanation:   Explanation of the Command.
        """
        #Call parent's init method
        Command.__init__(self, name, explanation)
示例#17
0
    def __init__(self, name, explanation, commandWords):
        """
        Initializes new help command.
        
        @param commandWords:        CommandWords used in game.
        """
        #Call parent's init method
        Command.__init__(self, name, explanation)

        self._commandWords = commandWords
示例#18
0
 def __init__(self):
     Command.__init__(self)
     self.commands_function["-f"] = self.uploadFile
     self.commands_function["-file"] = self.uploadFile
     self.commands_function["-e"] = self.eraseDefault
     self.commands_function["-erase"] = self.eraseDefault
     self.commands_function["-ef"] = self.eraseUploadFile
     self.commands_function["-erasefile"] = self.eraseUploadFile
     self.commands_function["-h"] = self.help
     self.commands_function["-help"] = self.help
示例#19
0
    def __init__(self, address, command):
        opts = ('StrictHostKeyChecking=no',
                'PasswordAuthentication=no')

        argv = ['ssh', '-t']
        for opt in opts:
            argv += [ "-o", opt ]

        argv += [ address, command ]
        Command.__init__(self, argv, setpgrp=True)
示例#20
0
文件: init.py 项目: Aborres/tfc
 def __init__(self):
   Command.__init__(self)
   self.commands_function["-f"] = self.initForce
   self.commands_function["-force"] = self.initForce
   self.commands_function["-e"] = self.erase
   self.commands_function["-erase"] = self.erase
   self.commands_function["-c"] = self.clone
   self.commands_function["-clone"] = self.clone
   self.commands_function["-h"] = self.help
   self.commands_function["-help"] = self.help
示例#21
0
    def __init__(self, df, template_handler):
        '''
        (Screener, DataFrame, TemplateHandler) -> None

        Initializes a Screener
        '''
        Command.__init__(self)
        # copy the dataframe (in the event of mutation)
        self._df = df[:]
        self._th = template_handler
示例#22
0
    def __init__(self):
        Command.__init__(
            self, {
                "encrypt": self.__encrypt,
                "enc_hex": self.__enc_hex,
                "decrypt": self.__decrypt,
                "dec_hex": self.__decrypt_hex
            })

        self.cipher = VernamCipher()
示例#23
0
文件: init.py 项目: Aborres/tfc
 def __init__(self):
     Command.__init__(self)
     self.commands_function["-f"] = self.initForce
     self.commands_function["-force"] = self.initForce
     self.commands_function["-e"] = self.erase
     self.commands_function["-erase"] = self.erase
     self.commands_function["-c"] = self.clone
     self.commands_function["-clone"] = self.clone
     self.commands_function["-h"] = self.help
     self.commands_function["-help"] = self.help
示例#24
0
    def __init__(self, name, explanation, commandWords):
        """
        Initializes new help command.
        
        @param commandWords:        CommandWords used in game.
        """
        #Call parent's init method
        Command.__init__(self, name, explanation)

        self._commandWords = commandWords
示例#25
0
    def __init__(self, name, explanation, player):
        """
        Initializes new check inventory command.

        @param name: Command name.
        @param explanation: Explanation of command.
        @param player: The player object
        """
        #Call parent's init method
        Command.__init__(self, name, explanation)

        self._player = player
示例#26
0
    def __init__(self, name, explanation, player):
        """
        Initializes new north command.

        @param name:            Command's name.
        @param explanation:     Description of what command does.
        @param player:          Reference to command.
        """
        #Call parent's init method
        Command.__init__(self, name, explanation)

        self._player = player
    def __init__(self, name, explanation, player):
        """
        Initializes new describe command.

        @param name:         The name of player.
        @param explanation:  Explanation of player.
        @param player:       The player object.
        """
        #Call parent's init method
        Command.__init__(self, name, explanation)
        
        self._player = player
示例#28
0
    def __init__(self, name, explanation, player):
        """
        Initializes new pick up command.

        @param name:         Command name.
        @param explanation:  Explanation of command.
        @param player:       The player object.
        """
        #Call parent's init method
        Command.__init__(self, name, explanation)

        self._player = player
    def __init__(self, name, explanation, player):
        """
        Initializes new describe command.

        @param name:         The name of player.
        @param explanation:  Explanation of player.
        @param player:       The player object.
        """
        #Call parent's init method
        Command.__init__(self, name, explanation)
        
        self._player = player
示例#30
0
    def __init__(self, name, explanation, player):
        """
        Initializes east command.

        @param name:            Command's name.
        @param explanation:     Description of what command does.
        @param player:          Reference to command.
        """
        #Call parent's init method
        Command.__init__(self, name, explanation, time = True)

        self._player = player
示例#31
0
文件: dir.py 项目: Aborres/tfc
 def __init__(self):
     Command.__init__(self)
     self.commands_function["-mkdir"] = self.makeDirectory
     self.commands_function["-makedir"] = self.makeDirectory
     self.commands_function["-ls"] = self.listDirectory
     self.commands_function["-list"] = self.listDirectory
     self.commands_function["-e"] = self.erase
     self.commands_function["-erase"] = self.erase
     self.commands_function["-ef"] = self.eraseFolder
     self.commands_function["-erasefolder"] = self.eraseFolder
     self.commands_function["-h"] = self.help
     self.commands_function["-help"] = self.help
示例#32
0
文件: dir.py 项目: Aborres/tfc
 def __init__(self):
   Command.__init__(self)
   self.commands_function["-mkdir"] = self.makeDirectory
   self.commands_function["-makedir"] = self.makeDirectory
   self.commands_function["-ls"] = self.listDirectory
   self.commands_function["-list"] = self.listDirectory
   self.commands_function["-e"] = self.erase
   self.commands_function["-erase"] = self.erase
   self.commands_function["-ef"] = self.eraseFolder
   self.commands_function["-erasefolder"] = self.eraseFolder
   self.commands_function["-h"] = self.help
   self.commands_function["-help"] = self.help
示例#33
0
        def __init__(self,
                     address,
                     command,
                     identity_file=None,
                     login_name=None,
                     callback=None,
                     pty=False):
            self.address = address
            self.command = command
            self.callback = callback

            argv = self.argv(identity_file, login_name, pty, address, command)
            Command.__init__(self, argv, pty=pty, setpgrp=True)
示例#34
0
	def __init__(self):
		base1 = Node( ['set reminder'], self.remind1)
		base2 = Node( ['remind me'], self.remind2)

		message = Node( ['set message to'], self.setMessage)
		time = Node( ['set time to'], self.setTime)

		affirmTime = Node( ['yes'], self.affirmTime)
		daffirmTime = Node( ['no'], self.daffirmTime)
		affirmMessage = Node( ['yes'], self.affirmMessage)
		daffirmMessage = Node( ['no'], self.daffirmMessage)

		yesText = Node( ['yes'], self.yesText)
		noText = Node( ['no'], self.noText)

		tree = [[ base1,base2 ],[message,time],[affirmMessage,daffirmMessage,affirmTime,daffirmTime],[yesText,noText]]
                Command.__init__(self,tree)
示例#35
0
文件: config.py 项目: Aborres/tfc
 def __init__(self):
   Command.__init__(self)
   self.commands_function["-u"] = self.setUser
   self.commands_function["-user"] = self.setUser
   self.commands_function["-s"] = self.setServer
   self.commands_function["-server"] = self.setServer
   self.commands_function["-p"] = self.setPort
   self.commands_function["-port"] = self.setPort
   self.commands_function["-ps"] = self.setPassword
   self.commands_function["-password"] = self.setPassword
   self.commands_function["-uf"] = self.setUploadFolder
   self.commands_function["-uploadfolder"] = self.setUploadFolder
   self.commands_function["-df"] = self.setDownloadFolder
   self.commands_function["-downloadfolder"] = self.setDownloadFolder
   self.commands_function["-timeout"] = self.setTimeOut
   self.commands_function["-h"] = self.help
   self.commands_function["-help"] = self.help
   self.commands_function["-w"] = self.welcome
   self.commands_function["-welcome"] = self.welcome
   self.commands_function["-i"] = self.info
   self.commands_function["-info"] = self.info
示例#36
0
 def __init__(self):
     Command.__init__(self)
     self.commands_function["-u"] = self.setUser
     self.commands_function["-user"] = self.setUser
     self.commands_function["-s"] = self.setServer
     self.commands_function["-server"] = self.setServer
     self.commands_function["-p"] = self.setPort
     self.commands_function["-port"] = self.setPort
     self.commands_function["-ps"] = self.setPassword
     self.commands_function["-password"] = self.setPassword
     self.commands_function["-uf"] = self.setUploadFolder
     self.commands_function["-uploadfolder"] = self.setUploadFolder
     self.commands_function["-df"] = self.setDownloadFolder
     self.commands_function["-downloadfolder"] = self.setDownloadFolder
     self.commands_function["-timeout"] = self.setTimeOut
     self.commands_function["-h"] = self.help
     self.commands_function["-help"] = self.help
     self.commands_function["-w"] = self.welcome
     self.commands_function["-welcome"] = self.welcome
     self.commands_function["-i"] = self.info
     self.commands_function["-info"] = self.info
示例#37
0
    def __init__(self, obj):
        Command.__init__(self)
        self.return_value = {"status": "running"}
        self.return_value["result"] = 0
        self.return_value["id"] = self.id

        try:
            if "script" in obj:
                stdout_backup = sys.stdout
                new_stdout = StringIO.StringIO()
                sys.stdout = new_stdout

                exec(obj["script"])

                sys.stdout = stdout_backup

                self.return_value["output"] = new_stdout.getvalue().split('\n')
                new_stdout.close()
                self.return_value["status"] = "complete"

        except Exception as e:
            self.return_value["status"] = "error"
            self.return_value["output"] = [e.message]
示例#38
0
	def __init__(self, arch, freq):
		Command.__init__(self, arch, freq)
示例#39
0
文件: repo_cmd.py 项目: krep2/krep
 def __init__(self, *args, **kws):
     Command.__init__(self, *args, **kws)
     self.repo = FileUtils.find_execute('repo')
示例#40
0
 def __init__(self, game):
     """ Initialize the Command """
     self.game = game
     Command.__init__(self, [CurrentPlayer(), NoRequest()])
示例#41
0
        def __init__(self):
		tree = [[ Node( ['thank you','thanks'], self.thanks) ]]
                Command.__init__(self,tree)
示例#42
0
 def __init__(self, flow, cmd_name, params):
     Command.__init__(self, flow, cmd_name, params)
示例#43
0
 def __init__(self):
     Command.__init__(self)
     self.commands = []
示例#44
0
 def __init__ (self, parser):
     """
     parser - экземпляр парсера
     """
     Command.__init__ (self, parser)
示例#45
0
        def __init__(self):
		tree = [[ Node( ['goodnight','sleep','go to bed'], self.goodnight) ]]
                Command.__init__(self,tree)
示例#46
0
 def __init__ (self, parser):
     Command.__init__ (self, parser)
 def __init__(self):
     tree = [[Node(["remove alarm"], self.removeAlarms)]]
     Command.__init__(self, tree)
示例#48
0
 def __init__(self):
     Command.__init__(self)
示例#49
0
 def __init__(self, task, log=None):
     Command.__init__(self, task, log=log)
     self._task = task
     self._log = log
     self.setPath('/home/ishikura/Nagara/app/bin/marvin')
     self.__input_fmts = {}
        def __init__(self):
		tree = [[ Node(['adjust volume'], self.ask) ],[ Node(['percent volume'],self.adjust) ]]
                Command.__init__(self,tree)
示例#51
0
	def __init__(self, ifName, newValue):
		Command.__init__(self)
		self.ifName = ifName
		self.newValue = newValue
		self.oldValue = str(self.ifc.getAddr(ifName))
示例#52
0
 def __init__(self, index, owner):
     """ Initialize the Play Card Command """
     self.owner = owner
     self.cardFinder = IndexInZone(index, HAND)
     Command.__init__(self, [CurrentPlayer(), NoRequest(), self.cardFinder])
        def __init__(self):
		tree=[[ Node( ['list alarms'], self.listAlarms) ]]
                Command.__init__(self,tree)
示例#54
0
	def __init__(self, arch, freq, volume):
		Command.__init__(self, arch, freq)
		self.volume = volume
 def __init__(self):
     Command.__init__(self)
     self.door_cmd_pub = self.Publisher('door_cmd', DoorCmd, queue_size=10)
示例#56
0
 def __init__(self):
   Command.__init__(self)
示例#57
0
	def __init__(self, arch, freq, interface):
		Command.__init__(self, arch, freq)
		self.interface = interface