本文整理汇总了Python中kivy.core.clipboard.Clipboard.copy方法的典型用法代码示例。如果您正苦于以下问题:Python Clipboard.copy方法的具体用法?Python Clipboard.copy怎么用?Python Clipboard.copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.core.clipboard.Clipboard
的用法示例。
在下文中一共展示了Clipboard.copy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_touch_down
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def on_touch_down(self, touch):
if touch.is_double_tap:
try:
Clipboard.copy(self.query_tree.selected_node.text)
except AttributeError:
Logger.debug("SQL Panel: Object didn't have text.")
ScrollView.on_touch_down(self, touch)
示例2: _update_pos
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def _update_pos(self, dt):
'''
get and update position
'''
e, n, lon, lat = get_nmea(self)
try:
self.e_txt.text = e[:10]#self.dat['e'][:10]
self.n_txt.text = n[:10]#self.dat['n'][:10]
except:
pass
Clipboard.copy(self.n_txt.text+':'+self.e_txt.text)
tmp = Clipboard.paste()
self.n_txt.text = tmp.split(':')[0]
self.e_txt.text = tmp.split(':')[1]
if MAKEMAP:
self.map.simple_marker([lat, lon], marker_color='red')
self.map.save(self.mapname)
if SHOWMAP:
# plot position and color code by time elapsed
secs = time.mktime(time.localtime())-self.starttime
self.fig.gca().scatter(float(e),float(n),s=30,c=secs, vmin=1, vmax=1200, cmap='Greens')
self.fig.gca().set_ylim([float(n)-IMBOX_Y, float(n)+IMBOX_Y])
self.fig.gca().set_xlim([float(e)-IMBOX_X, float(e)+IMBOX_X])
self.fig.canvas.draw()
示例3: copy
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def copy(self,text):
try:
from kivy.core.clipboard import Clipboard
Clipboard.copy(text)
except:
logger.error("Could not be copied to clipboard: "+text)
pass
示例4: _update_pos
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def _update_pos(self, dt):
'''
get and update position
'''
#self.dat = get_nmea(self)
e, n, d = get_nmea(self)
#now = time.asctime().replace(' ','_').replace(':','_')
try:
self.e_txt.text = e[:10]#self.dat['e'][:10]
self.n_txt.text = n[:10]#self.dat['n'][:10]
except:
pass
#self.textinput.text += 'Position obtained: '+now+'\n'
Clipboard.copy(self.n_txt.text+':'+self.e_txt.text)
tmp = Clipboard.paste()
self.n_txt.text = tmp.split(':')[0]
self.e_txt.text = tmp.split(':')[1]
#self.textinput.text += 'N: '+str(self.n_txt.text)+', E: '+str(self.e_txt.text)+', D: '+str(self.dat['depth_m'])+'\n'
#self.textinput2.text += str(self.dat['depth_m'])+' m'+'\n'
self.textinput2.text += d+' m'+'\n'
if float(d)>10: #self.dat['depth_m']>10:
self.textinput2.foreground_color = (0.6,0.5,0.0,1.0)
elif d=='NaN':#self.dat['depth_m']=='NaN':
self.textinput2.foreground_color = (0.25,0.5,0.25,0.25)
else:
self.textinput2.foreground_color = (0.0,0.0,0.0,0.0)
示例5: _update_pos
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def _update_pos(self, dt):
'''
get and update position
'''
e, n, lon, lat = get_nmea(self)
# d = get_nmeadepth(self)
try:
self.e_txt.text = e[:10]#self.dat['e'][:10]
self.n_txt.text = n[:10]#self.dat['n'][:10]
# self.d_txt.text = d
except:
pass
Clipboard.copy(self.n_txt.text+':'+self.e_txt.text)
示例6: _update_pos
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def _update_pos(self, dt):
'''
get and update position
'''
e, n, lon, lat = get_nmea(self)
try:
self.e_txt.text = e[:10]#self.dat['e'][:10]
self.n_txt.text = n[:10]#self.dat['n'][:10]
except:
pass
Clipboard.copy(self.n_txt.text+':'+self.e_txt.text)
tmp = Clipboard.paste()
self.n_txt.text = tmp.split(':')[0]
self.e_txt.text = tmp.split(':')[1]
示例7: test_paste_text_max
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def test_paste_text_max(self):
"""
paste_text()
if len(self.pasted_str) >= 1000:
"""
from kivy.core.clipboard import Clipboard
_clipboard = Clipboard.copy("test" * 1000)
test_paste = self.encrypt.paste_text()
self.assertEqual(test_paste, "")
示例8: test_paste_text
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def test_paste_text(self):
"""
paste_text()
else: return self.pasted_str
"""
from kivy.core.clipboard import Clipboard
_clipboard = Clipboard.copy("test")
test_paste = self.encrypt.paste_text()
self.assertEqual(test_paste, "test")
示例9: on_start
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def on_start(self):
text = ''
if CutBuffer:
text = CutBuffer.get_cutbuffer()
else:
cbbtn = root.ids.cutbuffer
cbbtn.parent.remove_widget(cbbtn)
if not text:
text = Clipboard.copy()
root.ids.source.text = text or ''
root.ids.manip.focus = True
示例10: cpClipboard
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def cpClipboard(self):
print("Copy current Kanji to clipboard")
Clipboard.copy("{}".format(self.master_kanji.cur_framekanji)) # TODO fix UTF8
print(Clipboard.get_types())
示例11: copy_to_clipboard
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def copy_to_clipboard(self, data):
from kivy.core.clipboard import Clipboard
Clipboard.copy(data)
示例12: on_clipboard
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def on_clipboard(self, *args):
'''Event handler to "Copy to Clipboard" button
'''
Clipboard.copy(self.txt_traceback.text)
示例13: paste_clipboard
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def paste_clipboard(text):
# convert to appropriate format
text = unicode(text)
Clipboard.copy(text)
示例14: binding
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def binding(btn):
text_to_copy = self.hash_repr.text[:self.hash_repr.format_border]
Clipboard.copy(text_to_copy)
示例15: copy_output
# 需要导入模块: from kivy.core.clipboard import Clipboard [as 别名]
# 或者: from kivy.core.clipboard.Clipboard import copy [as 别名]
def copy_output(self):
Clipboard.copy(root.ids.output.text)
if CutBuffer:
CutBuffer.set_cutbuffer(root.ids.output.text)