예제 #1
0
    def MakeActions(self):
        act = actions.Actions(self)

        act.AddAction(self.ID_ADD, u"添加联系人", glob.getBitmap('add'),
                      self.OnCmdAddRoster)

        act.AddAction(self.ID_GROUPCHAT, u"群聊", glob.getBitmap('groupchat'),
                      None)

        act.AddAction(
            self.ID_SEND_FILE,
            u"发送文件",
            glob.getBitmap('filetransfer'),
            self.OnCmdSendFile,
        )

        act.AddAction(self.ID_PERSONAL_INFO, u"个人信息", glob.getBitmap('self'),
                      self.OnCmdPersonalInfo)

        act.AddCheckAction(self.ID_CHECK_OFFLINE,
                           u"显示离线联系人",
                           glob.getBitmap('offline'),
                           self.OnCmdHideOffline,
                           checked=True)

        #act.AddAction( ,)
        #act.AddAction( ,)
        #act.AddAction( ,)

        return act
예제 #2
0
def setup(bot, config):
    if 'general' in config['modules']:
        bot.add_cog(general.GeneralCommands(bot, config['general']))
    if 'regions' in config['modules']:
        bot.add_cog(regions.RegionCommands(bot, config['regions']))
    if 'actions' in config['modules']:
        bot.add_cog(actions.Actions(bot))
예제 #3
0
파일: gameGUI.py 프로젝트: irish3725/Korby
    def __init__(self):
        # create widow
        self.win = tk.Tk()
        # list of actions for actual movement
        # self.actions = [['animation', '', 0]]
        self.actions = []
        # actual action buttons for placing on the screen
        self.aButtons = actions.Actions(self.win, self)
        # create Korby object for moving robot
        self.Korb = Korby.Korby(self.win)
        # load background image
        self.bg_img = tk.PhotoImage(file='korby_face.gif')
        self.bg_label = tk.Label(self.win, image=self.bg_img)
        # place background image
        self.bg_label.place(x=0, y=0, relwidth=1, relheight=1)
        # radio button variable
        self.radio = 0
        # direction for things
        self.direction = 'up'
        # variable for storing duration
        self.duration = 1

        self.firstMove = True
        self.player = player(1)
        self.lastMove = "north"
        self.newMove = ""
        self.gameText = ""
        self.game180 = 3
        self.game90 = 1.5
        self.gameForward = 1
예제 #4
0
    def MakeActions(self):
        act = actions.Actions(self)

        act.AddAction(self.ID_IMPORT, u"导入", glob.getBitmap('import'),
                      self.OnCmdImport)

        act.AddAction(self.ID_EXPORT, u"导出", glob.getBitmap('export'),
                      self.OnCmdExport)

        act.AddAction(self.ID_ADD_ITEM, u"添加", glob.getBitmap('add'),
                      self.OnCmdAddItem)

        act.AddAction(self.ID_DEL_ITEM, u"删除", glob.getBitmap('remove'),
                      self.OnCmdDelItem)

        act.AddAction(self.ID_SAVE, u"保存", glob.getBitmap('save'),
                      self.OnCmdSave)

        return act
예제 #5
0
def main():
    user = sys.argv[1]
    playlist_list = list(sys.argv[2:])
    print(sys.argv[2])

    scopes = 'playlist-read-private,playlist-modify-private'
    token = spotipy.util.prompt_for_user_token("*****@*****.**",
                                               scopes)
    sp = spotipy.Spotify(auth=token)

    g = get.Get(user, sp)
    s = save.Save()
    l = load.Load()
    a = actions.Actions(g, s, l, user, sp)

    #TODO add switch for what mode the user wants
    # collect all frames and lists in a class or something
    # mode switching

    a.get_user_playlists()
    for name in playlist_list:
        a.get_recommendations(name)
예제 #6
0
    def __init__(self, resources_path, cardsfile, log, http_port, notifierx, use_cardservice, handlers, enrichers,
                 actionsx, pages, services):
        self.notifier = notifierx
        self.cardstore = cards.CardStore(cardsfile, use_cardservice)
        self.services = services
        self._swisher_dir = resources_path

        self.actions = actions.Actions(self.cardstore,
                                       handlers,
                                       enrichers,
                                       actionsx
        )
        self.cardmanager = cardmanager.CardManager(self.cardstore, self.actions, self.notifier.notify)

        pages += [
            ("Cards", lambda c: web.CardsPage(c, self.cardstore)),
            ("Actions", lambda c: actions.ActionsPage(c, self.actions)),
        ]
        self.web = web.Web(resources_path, log, http_port, ["box-functions.js"], pages)
        self.web.root.longPoll = web.LongPollStatus(self.notifier)
        self.web.root.action = web.ActionPage(self.actions, self.cardmanager)
        self.web.root.action.exposed = True
예제 #7
0
파일: server.py 프로젝트: 9Skrip/swisher
    def __init__(self, resources_path, cardsfile, log, http_port, notifierx,
                 use_cardservice, players):
        self.notifier = notifierx
        self.cardstore = cards.CardStore(cardsfile, use_cardservice)
        self._swisher_dir = resources_path
        self.players = players
        self.actions = actions.Actions(self.cardstore, players, [])
        self.cardmanager = cardmanager.CardManager(self.cardstore,
                                                   self.actions,
                                                   self.notifier.notify)
        pages = []
        for player in players:
            pages += player.pages()
        pages += [
            ("Cards", lambda c: web.CardsPage(c, self.cardstore)),
            ("Actions", lambda c: actions.ActionsPage(c, self.actions)),
        ]

        script_files = ["box-functions.js"]
        for p in players:
            script_files += p.script_files()
        self.web = web.Web(resources_path, log, http_port, script_files,
                           "webplayer.html", pages)
        webcontrolx = players[
            0]  #hack to get the web control player as this depends on websockets setup here
        WebSocketPlugin(cherrypy.engine).subscribe()
        cherrypy.tools.websocket = WebSocketTool()
        self.web.config.update({
            '/webcontrol': {
                'tools.websocket.on':
                True,
                'tools.websocket.handler_cls':
                webcontrolx.connections.handler_builder
            }
        })
        self.web.root.longPoll = web.LongPollStatus(self.notifier)
        self.web.root.action = web.ActionPage(self.actions, self.cardmanager)
        self.web.root.action.exposed = True
예제 #8
0
    def initGui(self):
        """Initialise the GUI of the plugin."""
        # Create action that will start plugin configuration
        self.action = QtGui.QAction('DOV - Erosiebezwaren',
                                    self.iface.mainWindow())

        # Add toolbar and menu item
        self.toolbar = self.iface.addToolBar('Erosiebezwaren toolbar')
        self.toolbar.setObjectName('ErosiebezwarenToolbar')
        self.iface.addPluginToMenu('DOV - Erosiebezwaren', self.action)

        self.utils = utils.Utils(self)
        self.selectionManagerPolygons = SelectionManager(
            self, self.settings.getValue('layers/tempSelectionPolygons'))
        self.selectionManagerPoints = SelectionManager(
            self, self.settings.getValue('layers/tempSelectionPoints'))
        self.annotationManager = AnnotationManager(self)
        self.actions = actions.Actions(self, self.iface.mainWindow(),
                                       self.toolbar)

        self.parcelInfoDock = ParcelInfoDock(self.iface.mainWindow())
        self.parcelInfoWidget = ParcelInfoWidget(self.parcelInfoDock, self)
        self.parcelInfoDock.setWidget(self.parcelInfoWidget)
예제 #9
0
 except ValueError:
     # (the_mz, c_counter, n_counter, o_counter) = parse_formula(row.formula)
     parsed_formula = formula.parse(row.formula, actions=formula_actions.Actions())
     the_mz = 0.0
     c_counter = 0
     n_counter = 0
     o_counter = 0
     for term in parsed_formula:
         the_mz += term["mass"]
         if term["atom"] == "C":
             c_counter += term["count"]
         if term["atom"] == "O":
             o_counter += term["count"]
         if term["atom"] == "N":
             n_counter += term["count"]
     parsed = nist_ion_descriptions.parse(row.ion_type, actions=actions.Actions())
     row.polarity = row.ion_type[-1]
     charge = 0
     z_string = parsed["z"]
     if z_string == "+":
         charge = 1
     elif z_string == "-":
         charge = -1
     else:
         if row.polarity == "+":
             charge = int(z_string[:(-1)])
         else:
             charge = (-1) * int(z_string[:(-1)])
     row.mz = ((the_mz * parsed["molecular_ion_count"]) + parsed["delta"] - (charge * electron)) / charge
 if "labeling" in unmatched:
     exics_list = [exics(row.polarity, row.mz, row.rt_start, row.rt_stop, row.mz_tol)]
예제 #10
0
import os.path
import json
import random
import uuid as uuid_package
import time
import copy

import pkgutil
import farm_game

import model
import logging
log = logging.Logging()
import actions
all_actions = actions.Actions()


from collections import OrderedDict

import gbm

actions = OrderedDict()
seeds = {}
names = {}

colormap = {
    'total_income': 'magenta',
    'total_bankbalance': 'magenta',
    'prod_grapes': 'purple',
    'prod_peachesOrganicBabyGold': 'gold',
    'prod_peachesBabyGold': 'yellow',
예제 #11
0
    def MakeActions(self):
        act = actions.Actions(self)

        act.AddAction(self.ID_SAVE, u"保存", glob.getBitmap('save'),
                      self.OnCmdSave)
        return act
예제 #12
0
 def __init__(self, new_game_engine):
     super().__init__(new_game_engine)
     self.name = "Arythrea"
     list_of_cards = actions.Actions(self._game_engine).actions_collection
     for card in list_of_cards:
         self.deed_deck.append(card)
예제 #13
0
import pyxhook
import time
import actions
import public as pub

PressedKeys = set()
pub.running = True


class KeyBind:
    def __init__(self, keys, action):
        self.keys = keys
        self.action = action


pub.Actions = actions.Actions()
Mappings = (KeyBind(('Control', 'x'), pub.Actions.kill),
            KeyBind(('Control', 'Return'),
                    pub.Actions.bullet_factory(major=True)),
            KeyBind(('Shift', 'Return'),
                    pub.Actions.bullet_factory(major=False)),
            KeyBind(('Alt', 'd'), pub.Actions.delete_factory(major=False)),
            KeyBind(('Alt', 'D'), pub.Actions.delete_factory(major=True)),
            KeyBind(('Alt', 'S'), pub.Actions.toggleDateCheck))


def filterKey(key):
    return key.replace('_L', '').replace('_R', '')


def KeyDown(event):