Пример #1
0
"""
Sends series of characters to UI. Based on xdotool. This tool must be installed.
This class uses fastest way: clipboard and xdotool.

Author Andrew Terekhine
Since 2011-11-23
"""
from Tkinter import Tk

import datetime
import sys
import tkSimpleDialog
import ClipboardUtil
import SendToUi

output = datetime.datetime.now().strftime("%Y%m%d%H%M%S")

Tk().withdraw()
text = tkSimpleDialog.askstring('Task category', 'Category::')

if text is None or text == "": sys.exit()

#works as well
#time.sleep(0.24)
#output = system.exec_command("date +%Y%m%d%H%M%S")
#time = output.stdout.readline()
storedClipboard = ClipboardUtil.pasteFromClipboardXsel()
SendToUi.sendText("task " + text + "\n" + "    " + output + " " +  "\n\n" + "solution" + "\n\n" + "info" + "\n\n" + "keywords")
SendToUi.sendKey("Home Up Up Up Up Up Up End")
ClipboardUtil.copyToClipboardXclip(storedClipboard)
Пример #2
0
"""
Sends series of characters to UI. Based on xdotool. This tool must be installed.
This class uses fastest way: clipboard and xdotool.

Author Andrew Terekhine
Since 2011-11-23
"""
from Tkinter import Tk

import datetime
import sys
import tkSimpleDialog
import ClipboardUtil
import SendToUi

output = datetime.datetime.now().strftime("%Y%m%d%H%M%S")

Tk().withdraw()
text = tkSimpleDialog.askstring('Task category', 'Category::')

if text is None or text == "": sys.exit()

#works as well
#time.sleep(0.24)
#output = system.exec_command("date +%Y%m%d%H%M%S")
#time = output.stdout.readline()
storedClipboard = ClipboardUtil.pasteFromClipboardXsel()
SendToUi.sendText("task " + text + "\n" + "    " + output + " " + "\n\n" +
                  "solution" + "\n\n" + "info" + "\n\n" + "keywords")
SendToUi.sendKey("Home Up Up Up Up Up Up End")
ClipboardUtil.copyToClipboardXclip(storedClipboard)
Пример #3
0
def search(keyword):
    KeyboardUtil.setDefaultLanguage()
    open()
    scanForKeyword()
    if keyword != "":
        SendToUi.sendKey(keyword)
Пример #4
0
def fireFoxAltWToCtrlW():
    if Common.isAtiveTitle(Common.FIREFOX_TITLE):
        SendToUi.sendKey("Alt")
        SendToUi.sendKey("Control+w")
Пример #5
0
def scanForKeyword():
    SendToUi.sendKey("Control+Home Control+e underscore underscore")
Пример #6
0
def search(keyword):
    KeyboardUtil.setDefaultLanguage()
    open()
    scanForKeyword()
    if keyword != "":
        SendToUi.sendKey(keyword)
Пример #7
0
def scanForKeyword():
    SendToUi.sendKey("Control+Home Control+e underscore underscore")
Пример #8
0
def fireFoxAltWToCtrlW():
    if Common.isAtiveTitle(Common.FIREFOX_TITLE):
        SendToUi.sendKey("Alt")
        SendToUi.sendKey("Control+w")
Пример #9
0
def googleMail():
    if Common.isAtiveTitle(Common.INTELLIJ_IDEA_TITLE):
        time.sleep(0.05)  # important it won't work without a timeout
        SendToUi.sendKey("alt+F3")
    else:
        openExecute(SITE_GOOGLE_MAIL)