Code Duplication    Length = 13-13 lines in 2 locations

rsudp/c_tweet.py 1 location

@@ 96-108 (lines=13) @@
93
		printM('Starting.', self.sender)
94
95
96
	def _resolve_extra_text(self, extra_text):
97
		allowable_len = 103	# length of string allowable given maximum message text & region
98
		if ((extra_text == '') or (extra_text == None) or (extra_text == False)):
99
			self.extra_text = ''
100
		else:
101
			extra_text = str(extra_text)
102
			len_ex_txt = len(extra_text)
103
104
			if len_ex_txt > allowable_len:
105
				printW('extra_text parameter is longer than allowable (%s chars) and will be truncated. Please keep extra_text at or below %s characters.' % (len_ex_txt, allowable_len), sender=self.sender)
106
				extra_text = extra_text[:allowable_len]
107
108
			self.extra_text =  ' %s' % (extra_text)
109
110
111
	def auth(self):

rsudp/c_telegram.py 1 location

@@ 60-72 (lines=13) @@
57
		printM('Starting.', self.sender)
58
59
60
	def _resolve_extra_text(self, extra_text):
61
		allowable_len = 4096 - (280-103)	# length of string allowable given maximum message text & region
62
		if ((extra_text == '') or (extra_text == None) or (extra_text == False)):
63
			self.extra_text = ''
64
		else:
65
			extra_text = str(extra_text)
66
			len_ex_txt = len(extra_text)
67
68
			if len_ex_txt > allowable_len:
69
				printW('extra_text parameter is longer than allowable (%s chars) and will be truncated. Please keep extra_text at or below %s characters.' % (len_ex_txt, allowable_len), sender=self.sender)
70
				extra_text = extra_text[:allowable_len]
71
72
			self.extra_text =  ' %s' % (extra_text)
73
74
75
	def auth(self):