@@ -774,6 +774,15 @@ def pastebin(self, s=None):
774774 not self .interact .confirm ("Pastebin buffer? (y/N) " )):
775775 self .interact .notify ("Pastebin aborted" )
776776 return
777+ return do_pastebin (s )
778+
779+
780+ def do_pastebin (self , s ):
781+ if s == self .prev_pastebin_content :
782+ self .interact .notify ('Duplicate pastebin. Previous URL: ' +
783+ self .prev_pastebin_url )
784+ return self .prev_pastebin_url
785+
777786 if self .config .pastebin_helper :
778787 return self .do_pastebin_helper (s )
779788 else :
@@ -788,11 +797,6 @@ def do_pastebin_xmlrpc(self, s):
788797 (self .config .pastebin_url , str (e )))
789798 return
790799
791- if s == self .prev_pastebin_content :
792- self .interact .notify ('Duplicate pastebin. Previous URL: ' +
793- self .prev_pastebin_url )
794- return self .prev_pastebin_url
795-
796800 self .prev_pastebin_content = s
797801
798802 self .interact .notify ('Posting data to pastebin...' )
@@ -812,11 +816,6 @@ def do_pastebin_xmlrpc(self, s):
812816
813817 def do_pastebin_helper (self , s ):
814818 """Call out to helper program for pastebin upload."""
815- if s == self .prev_pastebin_content :
816- self .interact .notify ('Duplicate pastebin. Previous URL: ' +
817- self .prev_pastebin_url )
818- return self .prev_pastebin_url
819-
820819 self .interact .notify ('Posting data to pastebin...' )
821820
822821 try :
0 commit comments