本文整理汇总了Python中utils.path_to_url函数的典型用法代码示例。如果您正苦于以下问题:Python path_to_url函数的具体用法?Python path_to_url怎么用?Python path_to_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了path_to_url函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _prepare_history
def _prepare_history(self):
'''clean up ouput'''
self.nicebar.empty_queue()
if self.contact:
his_picture = self.contact.picture or utils.path_to_url(os.path.abspath(gui.theme.image_theme.user))
my_picture = self.session.contacts.me.picture or utils.path_to_url(os.path.abspath(gui.theme.image_theme.user))
self.text.clear(self.account, self.contact.nick, self.contact.display_name, my_picture, his_picture)
else:
self.text.clear()
示例2: refresh_history
def refresh_history(self):
'''refresh the history according to the values on the calendars
'''
if self.contact:
his_picture = self.contact.picture or utils.path_to_url(os.path.abspath(gui.theme.user))
my_picture = self.session.contacts.me.picture or utils.path_to_url(os.path.abspath(gui.theme.user))
self.text.clear(self.account, self.contact.nick, self.contact.display_name, my_picture, his_picture)
else:
self.text.clear()
self.request_chats_between(1000, self._on_chats_ready)
示例3: clear
def clear(self, source="", target="", target_display="", source_img="", target_img=""):
"""clear the content"""
body = self.theme.get_body(source, target, target_display, source_img, target_img)
self.load_string(body, "text/html", "utf-8", utils.path_to_url(self.theme.path))
self.pending = []
self.ready = False
self.last_incoming = None
示例4: clear
def clear(self, source="", target="", target_display="",
source_img="", target_img=""):
'''clear the content'''
body = self.theme.get_body(source, target, target_display, source_img,
target_img)
self.delayed_call(self._load_string, body,
"text/html", "utf-8", utils.path_to_url(self.theme.path))
示例5: __init__
def __init__(self, config, add_emoticon_cb):
"""constructor"""
gtk.ScrolledWindow.__init__(self)
self.config = config
self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self.set_shadow_type(gtk.SHADOW_IN)
self.loaded = False
picture = utils.path_to_url(os.path.abspath(gui.theme.image_theme.user))
self.view = OutputView(gui.theme.conv_theme, "", "", "", picture, picture, add_emoticon_cb)
self.clear()
self.view.show()
self.add(self.view)
示例6: __init__
def __init__(self, config, add_emoticon_cb):
'''constructor'''
gtk.ScrolledWindow.__init__(self)
self.config = config
self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self.set_shadow_type(gtk.SHADOW_IN)
self._texts = []
self.loaded = False
picture = utils.path_to_url(os.path.abspath(gui.theme.user))
self.view = OutputView(gui.theme.conv_theme, "", "", "", picture,
picture, add_emoticon_cb)
self.view.connect('load-finished', self._loading_stop_cb)
self.view.connect('console-message', self._error_cb)
self.clear()
self.view.show()
self.add(self.view)
示例7: __init__
def __init__(self, session, cid, update_win, tab_label, members=None):
'''constructor'''
gtk.VBox.__init__(self)
gui.Conversation.__init__(self, session, cid, update_win, members)
self.set_border_width(2)
self.typing_timeout = None
self.tab_label = tab_label
self._header_visible = session.config.b_show_header
self._image_visible = session.config.b_show_info
self._toolbar_visible = session.config.b_show_toolbar
self.panel = gtk.VPaned()
self.show_avatar_in_taskbar = self.session.config.get_or_set(
'b_show_avatar_in_taskbar',
True)
Header = extension.get_default('conversation header')
OutputText = extension.get_default('conversation output')
InputText = extension.get_default('conversation input')
ContactInfo = extension.get_default('conversation info')
ConversationToolbar = extension.get_default(
'conversation toolbar')
TransfersBar = extension.get_default('filetransfer pool')
CallWidget = extension.get_default('call widget')
self.below_conversation = None
BelowConversation = extension.get_default('below conversation')
if BelowConversation is not None:
self.below_conversation = BelowConversation(self, session)
self.header = Header(session, members)
toolbar_handler = gui.base.ConversationToolbarHandler(self.session,
gui.theme, self)
self.toolbar = ConversationToolbar(toolbar_handler, self.session)
self.toolbar.set_property('can-focus', False)
outputview_handler = gui.base.OutputViewHandler(self)
self.output = OutputText(self.session.config, outputview_handler)
if self.session.conversation_start_locked:
self.output.lock()
self.output.set_size_request(-1, 30)
self.input = InputText(self.session, self._on_send_message,
self.cycle_history, self.on_drag_data_received,
self._send_typing_notification)
self.output.set_size_request(-1, 25)
self.input.set_size_request(-1, 25)
self.info = ContactInfo(self.session, self.members)
self.transfers_bar = TransfersBar(self.session)
self.call_widget = CallWidget(self.session)
frame_input = gtk.Frame()
frame_input.set_shadow_type(gtk.SHADOW_IN)
input_box = gtk.VBox()
input_box.pack_start(self.toolbar, False)
input_box.pack_start(self.input, True, True)
frame_input.add(input_box)
self.panel.pack1(self.output, True, False)
self.panel.pack2(frame_input, False, False)
if not check_gtk3():
self.panel_signal_id = self.panel.connect_after('expose-event',
self.update_panel_position)
else:
self.panel_signal_id = self.panel.connect_after('draw',
self.update_panel_position)
self.panel.connect('button-release-event', self.on_input_panel_resize)
self.hbox = gtk.HBox()
if self.session.config.get_or_set('b_avatar_on_left', False):
self.hbox.pack_start(self.info, False)
self.hbox.pack_start(self.panel, True, True)
else:
self.hbox.pack_start(self.panel, True, True)
self.hbox.pack_start(self.info, False)
self.pack_start(self.header, False)
self.pack_start(self.hbox, True, True)
self.pack_start(self.transfers_bar, False)
if self.below_conversation is not None:
self.pack_start(self.below_conversation, False)
if len(self.members) == 0:
self.header.information = ('connecting', 'creating conversation')
else:
#update adium theme header/footer
account = self.members[0]
contact = self.session.contacts.safe_get(account)
his_picture = contact.picture or utils.path_to_url(os.path.abspath(gui.theme.image_theme.user))
nick = contact.nick
display_name = contact.display_name
self.set_sensitive(not contact.blocked, True)
my_picture = self.session.contacts.me.picture or utils.path_to_url(os.path.abspath(gui.theme.image_theme.user))
self.output.clear(account, nick, display_name,
my_picture, his_picture)
#.........这里部分代码省略.........