本文整理汇总了Python中Settings.Settings.getAllowOneInstanceOnly方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.getAllowOneInstanceOnly方法的具体用法?Python Settings.getAllowOneInstanceOnly怎么用?Python Settings.getAllowOneInstanceOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings.Settings
的用法示例。
在下文中一共展示了Settings.getAllowOneInstanceOnly方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: importErrorDialog
# 需要导入模块: from Settings import Settings [as 别名]
# 或者: from Settings.Settings import getAllowOneInstanceOnly [as 别名]
importErrorDialog(_("This script needs pygtk 2.0 or higher"))
try:
from threading import Lock, BoundedSemaphore
from gobject import GError
from urllib import url2pathname
from pluginWrapper import uploadFile as uploadFileWrapper, runMethodInThread
from History_GTK import History_GTK
from Settings_GTK import Settings_GTK
from Settings import Settings
set = Settings()
from DB import DB
db=DB()
from helpers.gtkHelper import createCombobox, copyToClipBoard, populateCombobox, createThumbnail, getMimeTypes, saveThumbnail, isImage
from plugins import getUploader
#if allowOneInstanceOnly:
if set.getAllowOneInstanceOnly():
from AllowOnlyOneInstance import instanceExists, sendFilesToInstance
except ImportError, error:
importErrorDialog(error)
def showDialog(parent, description, title='PyShare dialog'):
"""shows gtk dialog with given title and description"""
parent.dialog = gtk.MessageDialog(
parent=None,
flags=gtk.DIALOG_DESTROY_WITH_PARENT,
type=gtk.MESSAGE_INFO,
buttons=gtk.BUTTONS_CLOSE,
message_format=description
)
parent.dialog.set_title(title)
parent.dialog.run()