本文整理汇总了Python中pyotherside.send函数的典型用法代码示例。如果您正苦于以下问题:Python send函数的具体用法?Python send怎么用?Python send使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: reporthook
def reporthook(blocknum, blocksize, totalsize):
readsofar = blocknum * blocksize
if totalsize > 0:
percent = (readsofar * 1e2 / totalsize) / 2.
pyotherside.send("on-progress", percent)
else:
sys.stderr.write("read %d\n" % (readsofar,))
开发者ID:delijati,项目名称:fosdem-qml,代码行数:7,代码来源:__init__.py
示例2: update_all_shows_episodes
def update_all_shows_episodes(self, show_list = []):
self.isUpdating = True
pyotherside.send('updating', self.isUpdating)
show_list = show_list or self.series_list
async_worker = AsyncWorker(False)
update_images_worker = AsyncWorker(True)
i = 0
n_shows = len(show_list)
for i in range(n_shows):
update_ended_shows = Settings().getConf(Settings.UPDATE_ENDED_SHOWS)
show = show_list[i]
if show.status and show.status == 'Ended' and not update_ended_shows:
async_item = AsyncItem(self._empty_callback, (),
self._set_show_episodes_complete_cb,
(show, update_images_worker, i == n_shows - 1))
async_worker.queue.put(async_item)
continue
pyotherside.send('episodesListUpdating', show.get_name())
show.set_updating(True)
async_item = AsyncItem(self.thetvdb.get_show_and_episodes,
(show.thetvdb_id, show.language,),
self._set_show_episodes_complete_cb,
(show, update_images_worker, i == n_shows - 1))
async_worker.queue.put(async_item)
async_item = AsyncItem(self._set_show_images,
(show,),
None,)
update_images_worker.queue.put(async_item)
async_worker.start()
return async_worker
开发者ID:corecomic,项目名称:seriesfinale,代码行数:30,代码来源:series.py
示例3: exportBookmarkstoSailfishBrowser
def exportBookmarkstoSailfishBrowser(bookmarks, sPath):
bookmark_list = []
home = os.environ['HOME']
path = '/.local/share/'
browser = 'org.sailfishos/sailfish-browser/'
timestamp = str(datetime.datetime.now().timestamp())
backup = sPath + '/bookmarks.json.bak' + timestamp
try:
bookmark_obj = json.loads(bookmarks)
with open(home + path + browser + 'bookmarks.json', 'r') as f:
exist_bookmarks = json.load(f)
exist_urls = []
for ebm in exist_bookmarks:
bookmark_list.append(ebm)
exist_urls.append(ebm['url'])
for bm in bookmark_obj:
if bm['url'] not in exist_urls:
bookmark = {
'favicon': 'icon-launcher-bookmark',
'hasTouchIcon': False,
'title': bm['title'],
'url': bm['url']
}
bookmark_list.append(bookmark)
os.renames(home + path + browser + 'bookmarks.json', backup)
with open(home + path + browser + 'bookmarks.json', 'w') as f:
json.dump(bookmark_list, f)
except:
pyotherside.send(traceback.print_exc())
开发者ID:hwesselmann,项目名称:harbour-cloudmarks,代码行数:33,代码来源:cloudmarks.py
示例4: _send_defaults
def _send_defaults(self):
"""Send default configuration to QML."""
pyotherside.send("set-attribution", self.tilesource.attribution)
pyotherside.send("set-auto-center", poor.conf.auto_center)
pyotherside.send("set-gps-update-interval", poor.conf.gps_update_interval)
pyotherside.send("set-center", *poor.conf.center)
pyotherside.send("set-zoom-level", poor.conf.zoom)
开发者ID:sailfishapps,项目名称:poor-maps,代码行数:7,代码来源:application.py
示例5: _threadStatusCB
def _threadStatusCB(self, threadName, threadStatus):
# check if the event corresponds to some of the
# in-progress search threads
recipient = self._threadsInProgress.get(threadName)
if recipient:
statusId = SEARCH_STATUS_PREFIX + recipient
pyotherside.send(statusId, threadStatus)
开发者ID:locusf,项目名称:modrana,代码行数:7,代码来源:gui_qt5.py
示例6: _search_finished_callback
def _search_finished_callback(self, tvdbshows, error):
if not error:
for show_id, show in tvdbshows:
self._cached_tvdb_shows[show_id] = show
self.search_results.append(show)
self.searching = False
pyotherside.send('searching', self.searching)
开发者ID:corecomic,项目名称:seriesfinale,代码行数:7,代码来源:series.py
示例7: download
def download(url):
'''Downloads specified file at specific url'''
u = req.urlopen(url)
if os.path.exists('retroarch_v1.0'):
return False
else:
with open('retroarch.zip', 'wb') as f:
meta = u.info()
meta_func = meta.getheaders if hasattr(meta, 'getheaders') else meta.get_all
meta_length = meta_func("Content-Length")
file_size = None
if meta_length:
file_size = int(meta_length[0])
file_size_dl = 0
block_sz = 8192
while True:
buff = u.read(block_sz)
if not buff:
break
file_size_dl += len(buff)
f.write(buff)
status = ""
if file_size:
status += "{0:6.2f}".format(file_size_dl * 100 / file_size)
status += chr(13)
pyotherside.send('download', status)
print('RetroArch was successfully downloaded')
return True
开发者ID:RonnChyran,项目名称:RetroarchPhoenix,代码行数:34,代码来源:download.py
示例8: paxel
def paxel(url, name,output, blocks=8):
size = GetUrlFileSize( url )
ranges = SpliteBlocks( size, blocks )
threadname = [ "thread_%d" % i for i in range(0, blocks) ]
filename = [ "tmpfile_%d" % i for i in range(0, blocks) ]
tasks = []
for i in range(0,blocks):
task = AxelPython( threadname[i], url, filename[i], ranges[i] )
task.setDaemon( True )
task.start()
tasks.append( task )
time.sleep(1)
while islive(tasks):
downloaded = sum( [task.downloaded for task in tasks] )
process = downloaded/float(size)*100
pyotherside.send("progress",name,process)
time.sleep( 0.3 )
filehandle = open( output, 'wb+' )
for i in filename:
f = open( i, 'rb' )
filehandle.write( f.read() )
f.close()
try:
os.remove(i)
pass
except:
pass
filehandle.close()
开发者ID:9smart,项目名称:harbour-9store,代码行数:33,代码来源:paxel.py
示例9: set_watched
def set_watched(self, watched):
if (self.watched == watched):
return
self.watched = watched
pyotherside.send('watchedChanged', self.watched)
pyotherside.send('infoMarkupChanged')
SeriesManager().updated()
开发者ID:corecomic,项目名称:seriesfinale,代码行数:7,代码来源:series.py
示例10: _update_tile
def _update_tile(self, tilesource, zoom, display_zoom, scale_factor, tile,
timestamp):
"""Download missing tile and ask QML to render it."""
key = tilesource.tile_key(tile)
item = self.tilecollection.get(key)
if item is not None:
return pyotherside.send("show-tile", item.uid)
path = tilesource.download(tile)
if path is None: return
uri = poor.util.path2uri(path) if os.path.isabs(path) else path
corners = tilesource.tile_corners(tile)
xmin, xmax, ymin, ymax = self._bbox
# Abort if map moved so that tile is no longer in view.
if xmax <= corners[2][0] or xmin >= corners[0][0]: return
if ymax <= corners[2][1] or ymin >= corners[0][1]: return
item = self.tilecollection.get_free(
key, path, xmin, xmax, ymin, ymax, display_zoom, corners)
pyotherside.send("render-tile", dict(display_zoom=display_zoom,
nex=corners[0][0],
nwx=corners[3][0],
nwy=corners[3][1],
scale=scale_factor*tilesource.scale,
half_zoom=tilesource.half_zoom,
smooth=tilesource.smooth,
swy=corners[2][1],
type=tilesource.type,
uid=item.uid,
uri=uri,
z=tilesource.z,
zoom=zoom))
开发者ID:otsaloma,项目名称:poor-maps,代码行数:30,代码来源:application.py
示例11: run
def run(self):
self.must_run = True
while self.must_run:
sleep(0.1)
if get_presence_auth_user() is None:
save_auth_user = load_presence_auth_user()
logger.debug("No auth user set")
if save_auth_user is not None:
logger.debug("Try to set the last one: "+ str(save_auth_user))
if save_auth_user in [i['name'] for i in load_presences()]:
set_presence_auth_user(save_auth_user)
# emit signal to select the auth user the auth_user list
pyotherside.send('set_selected_auth_user', save_auth_user)
# Process received sms queue
if not recv_sms_q.empty():
new_sms = recv_sms_q.get()
status = self.sms_received(new_sms['phone_number'],
new_sms['message'])
if status:
recv_sms_q.task_done()
# Process sms to send queue
if not send_sms_q.empty():
new_sms = send_sms_q.get()
self.send_sms(new_sms['to'],
new_sms['message'])
send_sms_q.task_done()
logger.debug("Scheduler stopped")
开发者ID:titilambert,项目名称:harbour-squilla,代码行数:27,代码来源:scheduler.py
示例12: getAuthorizationUrl
def getAuthorizationUrl():
try:
redirect_url = auth.get_authorization_url()
return redirect_url
except tweepy.TweepError:
pyotherside.send("Error! Failed to get request token.")
return ""
开发者ID:hwesselmann,项目名称:harbour-kormoran,代码行数:7,代码来源:kormoran.py
示例13: initialize
def initialize(self, progname):
assert self.core is None, 'Already initialized'
self.core = core.Core(progname=progname)
pyotherside.send('podcast-list-changed')
self.core.config.add_observer(self._config_option_changed)
开发者ID:paulmadore,项目名称:luckyde,代码行数:7,代码来源:main.py
示例14: unistall
def unistall(rpmname,version):
p = subprocess.Popen("pkcon remove "+rpmname,shell=True,stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
#0则安装成功
retval = p.wait()
print("removed,",rpmname)
pyotherside.send("status","4",rpmname,version)
return p.returncode
开发者ID:SunRain,项目名称:harbour-9store,代码行数:7,代码来源:mypy.py
示例15: set_title
def set_title(self, future=None):
title = get_conv_name(self.conv, show_unread=False,
truncate=True)
pyotherside.send('set-conversation-title', self.conv.id_, title, get_unread_messages_count(self.conv),
self.status_message)
if future:
future.result()
开发者ID:morphis,项目名称:ubuntu-hangups,代码行数:7,代码来源:__init__.py
示例16: install
def install(rpmpath):
p = subprocess.Popen("pkcon -y install-local "+rpmpath,shell=True,stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
#0则安装成功
retval = p.wait()
print("installed,",rpmpath)
pyotherside.send("2")
return p.returncode
开发者ID:9smart,项目名称:9Store,代码行数:7,代码来源:mypy.py
示例17: handle_data
def handle_data(self, data):
if self.gotDate == 1:
pyotherside.send('date_received', data)
pass
if self.counter2FirstEntrys > 14 and self.parseData == 1 and data != '\n' and data != '' and data != '\r' and self.endfile == 0:
if self.counter == 0:
self.liste[0]["klasse"] = data
self.counter = self.counter + 1
elif self.counter == 1:
self.liste[0]["stunde"] = data
self.counter = self.counter + 1
elif self.counter == 2:
self.liste[0]["vertreter"] = data
self.counter = self.counter + 1
elif self.counter == 3:
self.liste[0]["lehrer"] = data
self.counter = self.counter + 1
elif self.counter == 4:
self.liste[0]["fach"] = data
self.counter = self.counter + 1
elif self.counter == 5:
self.liste[0]["normRaum"] = data
self.counter = self.counter + 1
elif self.counter == 6:
self.liste[0]["raum"] = data
self.counter = self.counter + 1
elif self.counter == 7:
self.liste[0]["info"] = data
self.counter = self.counter + 1
pass
if self.parseData == 1:
self.counter2FirstEntrys = self.counter2FirstEntrys + 1
开发者ID:taaem,项目名称:qt-iserv,代码行数:33,代码来源:listmodel.py
示例18: _notifyQMLCB
def _notifyQMLCB(self, newTheme):
""" Notify the QML context that the modRana theme changed
:param newTheme: the new theme
:type newTheme: dict
"""
pyotherside.send("themeChanged", newTheme)
开发者ID:locusf,项目名称:modrana,代码行数:7,代码来源:gui_qt5.py
示例19: _searchCB
def _searchCB(self, searchId, results):
"""Handle address search results
:param list results: address search results
"""
# try to sort local search results by distance
# TODO: make this configurable
if searchId == "local":
pos = self.gui.get("pos", None)
if pos:
distanceList = []
for result in results:
distanceList.append((geo.distanceP2LL(result,pos[0], pos[1]), result))
distanceList.sort()
results = map(lambda x: x[1], distanceList)
# covert the Points in the results to a list of dicts
resultList = []
for result in results:
resultList.append(point2dict(result))
resultId = SEARCH_RESULT_PREFIX + searchId
pyotherside.send(resultId, resultList)
thisThread = threading.currentThread()
# remove the finished thread from tracking
if thisThread.name in self._threadsInProgress:
del self._threadsInProgress[thisThread.name]
开发者ID:locusf,项目名称:modrana,代码行数:26,代码来源:gui_qt5.py
示例20: _mark_all_episodes
def _mark_all_episodes(self, watched, season = None):
episodes = self.get_episodes_by_season(season)
for episode in episodes:
if episode.already_aired():
episode.watched = watched
SeriesManager().updated()
pyotherside.send('infoMarkupChanged')
开发者ID:corecomic,项目名称:seriesfinale,代码行数:7,代码来源:series.py
注:本文中的pyotherside.send函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论