Added copy to clipboard option

This commit is contained in:
Manuel Cortez 2015-07-29 08:40:07 -05:00
parent 9f2c240fc1
commit 6460c20a97
4 changed files with 13 additions and 6 deletions

View File

@ -696,6 +696,9 @@ class Controller(object):
msg = messages.viewTweet(tweet, tweetsList)
elif buffer.type == "account" or buffer.type == "empty":
return
elif buffer.name == "sent_tweets":
tweet, tweetsList = buffer.get_full_tweet()
msg = messages.viewTweet(tweet, tweetsList)
else:
non_tweet = buffer.get_formatted_message()
msg = messages.viewTweet(non_tweet, [], False)
@ -920,7 +923,7 @@ class Controller(object):
def left(self, *args, **kwargs):
buff = self.view.get_current_buffer_pos()
print buff
# print buff
buffer = self.get_current_buffer()
if not hasattr(buffer.buffer, "list"):
output.speak(_(u"No session is currently in focus. Focus a session with the next or previous session shortcut."), True)
@ -1336,7 +1339,7 @@ class Controller(object):
def insert_buffer(self, buffer, position):
# print ref_buf.name, ref_buf.account
# if ref_buf.account != buffer.account or ref_buf.type == "account" or type(ref_buf) == buffers.emptyPanel:
# buffers = self.get_buffers_for_account(buffer.account)
buffers = self.get_buffers_for_account(buffer.account)
ref_buf = self.buffers[position+1]
empty = True
for i in buffers[position+1:]:
@ -1358,4 +1361,8 @@ class Controller(object):
def change_buffer(self, bufferPosition):
buff = self.buffers[bufferPosition]
newPos = self.view.search(buff.name, buff.account)
self.view.change_buffer(newPos)
self.view.change_buffer(newPos)
def copy_to_clipboard(self, *args, **kwargs):
output.copy(self.get_current_buffer().get_message())
output.speak(_(u"Copied"))

View File

@ -36,7 +36,7 @@ update_profile = alt+win+p
delete = control+win+delete
clear_buffer = control+win+shift+delete
repeat_item = control+win+space
copy_to_clipboard = control+win+c
copy_to_clipboard = control+win+shift+c
add_to_list = control+win+a
remove_from_list = control+win+shift+a
toggle_buffer_mute = control+win+shift+m

View File

@ -24,7 +24,7 @@ def setup ():
except:
return logging.exception("Output: Error during initialization.")
def Copy(text):
def copy(text):
import win32clipboard
#Copies text to the clipboard.
win32clipboard.OpenClipboard()

View File

@ -28,7 +28,7 @@ class twitter(object):
def authorise(self, settings):
authorisationHandler.logged = False
port = random.randint(30000, 66000)
port = random.randint(30000, 65535)
httpd = BaseHTTPServer.HTTPServer(('127.0.0.1', port), authorisationHandler.handler)
if config.app["proxy"]["server"] != "" and config.app["proxy"]["port"] != "":
args = {"proxies": {"http": "http://{0}:{1}".format(config.app["proxy"]["server"], config.app["proxy"]["port"]),