mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-23 03:38:08 -06:00
Twishort preferences are saved
This commit is contained in:
parent
10bc483887
commit
370340de0b
@ -36,6 +36,7 @@ autoread_buffers = list(default=list(mentions, direct_messages, events))
|
|||||||
spelling_language = string(default="")
|
spelling_language = string(default="")
|
||||||
save_followers_in_autocompletion_db = boolean(default=False)
|
save_followers_in_autocompletion_db = boolean(default=False)
|
||||||
save_friends_in_autocompletion_db = boolean(default=False)
|
save_friends_in_autocompletion_db = boolean(default=False)
|
||||||
|
twishort_enabled = boolean(default=False)
|
||||||
|
|
||||||
[services]
|
[services]
|
||||||
pocket_access_token = string(default="")
|
pocket_access_token = string(default="")
|
@ -5,7 +5,7 @@ if snapshot == False:
|
|||||||
version = "0.80"
|
version = "0.80"
|
||||||
update_url = 'http://twblue.es/updates/twblue_ngen.json'
|
update_url = 'http://twblue.es/updates/twblue_ngen.json'
|
||||||
else:
|
else:
|
||||||
version = "9.9"
|
version = "9.10"
|
||||||
update_url = 'http://twblue.es/updates/snapshots_ngen.json'
|
update_url = 'http://twblue.es/updates/snapshots_ngen.json'
|
||||||
author = u"Manuel Cortéz, Bill Dengler"
|
author = u"Manuel Cortéz, Bill Dengler"
|
||||||
authorEmail = "manuel@manuelcortez.net"
|
authorEmail = "manuel@manuelcortez.net"
|
||||||
|
@ -127,8 +127,9 @@ class bufferController(object):
|
|||||||
def post_tweet(self, *args, **kwargs):
|
def post_tweet(self, *args, **kwargs):
|
||||||
title = _(u"Tweet")
|
title = _(u"Tweet")
|
||||||
caption = _(u"Write the tweet here")
|
caption = _(u"Write the tweet here")
|
||||||
tweet = messages.tweet(self.session, title, caption, "")
|
tweet = messages.tweet(self.session, title, caption, "", twishort_enabled=self.session.settings["mysc"]["twishort_enabled"])
|
||||||
if tweet.message.get_response() == widgetUtils.OK:
|
if tweet.message.get_response() == widgetUtils.OK:
|
||||||
|
self.session.settings["mysc"]["twishort_enabled"] = tweet.message.long_tweet.GetValue()
|
||||||
text = tweet.message.get_text()
|
text = tweet.message.get_text()
|
||||||
if len(text) > 140 and tweet.message.get("long_tweet") == True:
|
if len(text) > 140 and tweet.message.get("long_tweet") == True:
|
||||||
if tweet.image == None:
|
if tweet.image == None:
|
||||||
@ -374,8 +375,9 @@ class baseBufferController(bufferController):
|
|||||||
screen_name = tweet["user"]["screen_name"]
|
screen_name = tweet["user"]["screen_name"]
|
||||||
id = tweet["id"]
|
id = tweet["id"]
|
||||||
users = utils.get_all_mentioned(tweet, self.session.db)
|
users = utils.get_all_mentioned(tweet, self.session.db)
|
||||||
message = messages.reply(self.session, _(u"Reply"), _(u"Reply to %s") % (screen_name,), "@%s " % (screen_name,), users)
|
message = messages.reply(self.session, _(u"Reply"), _(u"Reply to %s") % (screen_name,), "@%s " % (screen_name,), users, twishort_enabled=self.session.settings["mysc"]["twishort_enabled"])
|
||||||
if message.message.get_response() == widgetUtils.OK:
|
if message.message.get_response() == widgetUtils.OK:
|
||||||
|
self.session.settings["mysc"]["twishort_enabled"] = message.message.long_tweet.GetValue()
|
||||||
text = message.message.get_text()
|
text = message.message.get_text()
|
||||||
if len(text) > 140 and message.message.get("long_tweet") == True:
|
if len(text) > 140 and message.message.get("long_tweet") == True:
|
||||||
if message.image == None:
|
if message.image == None:
|
||||||
@ -421,10 +423,11 @@ class baseBufferController(bufferController):
|
|||||||
self._retweet_with_comment(tweet, id)
|
self._retweet_with_comment(tweet, id)
|
||||||
|
|
||||||
def _retweet_with_comment(self, tweet, id, comment=''):
|
def _retweet_with_comment(self, tweet, id, comment=''):
|
||||||
retweet = messages.tweet(self.session, _(u"Retweet"), _(u"Add your comment to the tweet"), u"“@%s: %s ”" % (tweet["user"]["screen_name"], tweet["text"]), max=116-len("@%s " % (tweet["user"]["screen_name"],)), messageType="retweet")
|
retweet = messages.tweet(self.session, _(u"Retweet"), _(u"Add your comment to the tweet"), u"“@%s: %s ”" % (tweet["user"]["screen_name"], tweet["text"]), max=116-len("@%s " % (tweet["user"]["screen_name"],)), messageType="retweet", twishort_enabled=self.session.settings["mysc"]["twishort_enabled"])
|
||||||
if comment != '':
|
if comment != '':
|
||||||
retweet.message.set_text(comment)
|
retweet.message.set_text(comment)
|
||||||
if retweet.message.get_response() == widgetUtils.OK:
|
if retweet.message.get_response() == widgetUtils.OK:
|
||||||
|
self.session.settings["mysc"]["twishort_enabled"] = retweet.message.long_tweet.GetValue()
|
||||||
text = retweet.message.get_text()
|
text = retweet.message.get_text()
|
||||||
comments=text
|
comments=text
|
||||||
if len(text+ u"“@%s: %s ”" % (tweet["user"]["screen_name"], tweet["text"])) < 140:
|
if len(text+ u"“@%s: %s ”" % (tweet["user"]["screen_name"], tweet["text"])) < 140:
|
||||||
|
@ -111,11 +111,13 @@ class basicTweet(object):
|
|||||||
dlg = audioUploader.audioUploader(self.session.settings, completed_callback)
|
dlg = audioUploader.audioUploader(self.session.settings, completed_callback)
|
||||||
|
|
||||||
class tweet(basicTweet):
|
class tweet(basicTweet):
|
||||||
def __init__(self, session, title, caption, text, messageType="tweet", max=140):
|
def __init__(self, session, title, caption, text, twishort_enabled, messageType="tweet", max=140):
|
||||||
super(tweet, self).__init__(session, title, caption, text, messageType, max)
|
super(tweet, self).__init__(session, title, caption, text, messageType, max)
|
||||||
self.image = None
|
self.image = None
|
||||||
widgetUtils.connect_event(self.message.upload_image, widgetUtils.BUTTON_PRESSED, self.upload_image)
|
widgetUtils.connect_event(self.message.upload_image, widgetUtils.BUTTON_PRESSED, self.upload_image)
|
||||||
widgetUtils.connect_event(self.message.autocompletionButton, widgetUtils.BUTTON_PRESSED, self.autocomplete_users)
|
widgetUtils.connect_event(self.message.autocompletionButton, widgetUtils.BUTTON_PRESSED, self.autocomplete_users)
|
||||||
|
if twishort_enabled == False:
|
||||||
|
self.message.long_tweet.SetValue(False)
|
||||||
|
|
||||||
def upload_image(self, *args, **kwargs):
|
def upload_image(self, *args, **kwargs):
|
||||||
if self.message.get("upload_image") == _(u"Discard image"):
|
if self.message.get("upload_image") == _(u"Discard image"):
|
||||||
|
Loading…
Reference in New Issue
Block a user