예제 #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
파일: gerrit.py 프로젝트: corey-daemon/krep
    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
파일: ssh.py 프로젝트: JedMeister/cloudtask
    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
예제 #29
0
    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)
예제 #47
0
 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 = {}
예제 #50
0
        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])
예제 #53
0
        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