当前位置: 首页>>代码示例>>Python>>正文


Python Configuration.get_bool_option方法代码示例

本文整理汇总了Python中Configuration.Configuration.get_bool_option方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.get_bool_option方法的具体用法?Python Configuration.get_bool_option怎么用?Python Configuration.get_bool_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Configuration.Configuration的用法示例。


在下文中一共展示了Configuration.get_bool_option方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from Configuration import Configuration [as 别名]
# 或者: from Configuration.Configuration import get_bool_option [as 别名]
class application :
	def __init__(self):
		#init threading
		gobject.threads_init()
		#keep track of the window size
		self.window_height=0
		self.window_width=0
		self.window_is_hidden = False
		self.has_status_icon = False
		#keep track of the initial conversation id so that conversations don't colide
		self.conversation_id="0"
		#keep track of the filters
		self.filters ={'users':[],'strings':[]}
		self.options={'run_as_tray_app':False,'context_backwards':False,'no_avatars':False,'notifications':True,'notify_replies':False}
		#keep track of the direct_message requests
		self.last_direct_message_time=0
		#something something direct message
		self.is_direct_message_mode=False
		self.direct_message_to=None
		self.waiting_requests=0
		self.is_first_dents = True
		#keep track of the respond to id
		self.respond_to_id=0
		self.pre_group_page=None
		self.pre_user_page=None
		#keep track of the last time statuses where pulled
		self.last_get_statuses = 0
		#what are the assets?
		asset_dir = 'assets'
		heybuddy_dir = os.path.dirname( os.path.realpath( __file__ ) )
		self.readme_file = os.path.join(heybuddy_dir,'README.txt')
		self.standard_icon_path = os.path.join(heybuddy_dir,asset_dir,'icon.png')
		self.direct_icon_path = os.path.join(heybuddy_dir,asset_dir,'direct_icon.png')
		self.networking_icon_path = os.path.join(heybuddy_dir,asset_dir,'icon1.png')
		self.throbber_icon_path = os.path.join(heybuddy_dir,asset_dir,'throbber.gif')
		self.default_icon_path = self.standard_icon_path
		self.conf = Configuration(app_name)
		#has the account info been authenticated?
		self.credentials_verified = self.conf.get_bool('access', 'credentials_verified')
		self.xmlprocessor = XMLProcessor()
		#create a regex to replace parts of a dent
		self.regex_tag = re.compile("(^| )#([\w-]+)", re.UNICODE)
		self.regex_group = re.compile("(^| )!([\w-]+)")
		self.regex_user=re.compile("(^|[^A-z0-9])@(\w+)")
		self.regex_url=re.compile("(http[s]?://.*?)(\.$|\. |\s|$)",re.IGNORECASE)
		#get the initial dents
		self.initial_dents = self.conf.get('settings','initial_dents',default='20' )
		self.dent_limit = int(self.initial_dents)*2
		#get the pull time
		self.pull_time = self.conf.get('settings','pull_time',default='60')
		self.pull_time_changed_bool = False
		self.pull_time_mentions = False
		#build the gui
		self.build_gui()
		
		#where is the certs file?
		ca_certs_files = [
			"/etc/ssl/certs/ca-certificates.crt",
			"/etc/ssl/certs/ca-bundle.crt",
			]
		#what if there isn't a cert_file
		cert_file=None
		#determine the certs_file
		for f in ca_certs_files:
			if os.path.exists(f):
				cert_file=f
				break	
		
		#create the communicator
		self.comm = Communicator(app_name, cert_file)
		self.comm.connect('statusesXML',self.process_statusesXML,self.dentspage)
		self.comm.connect('mentionsXML',self.process_statusesXML,self.mentionspage)
		self.comm.connect('favoritesXML', self.process_statusesXML,self.favoritespage)
		self.comm.connect('group-statusesXML',self.process_statusesXML,self.grouppage)
		self.comm.connect('user-statusesXML',self.process_statusesXML,self.userpage)
		self.comm.connect('direct_messagesXML',self.process_statusesXML,self.directspage,True)
		self.comm.connect('conversationXML',self.process_conversationXML)
		self.comm.connect('userXML',self.process_userXML)
		self.comm.connect('groupXML',self.process_groupXML)
		self.comm.connect('new-statusXML',self.process_new_statusXML)
		self.comm.connect('redent-statusXML',self.process_new_statusXML)
		self.comm.connect('user_is_friendXML',self.process_user_is_friendXML)
		self.comm.connect('user_is_memberXML',self.process_user_is_memberXML)
		self.comm.connect('friendshipXML',self.process_friendshipXML)
		self.comm.connect('exception-caught',self.process_communication_exception)
		self.comm.connect('widget-image',self.process_widget_image)
		self.comm.connect('direct-messageXML',self.process_new_directXML)
		self.comm.connect('verify_credentialsXML',self.process_verifycredentialsXML)
		self.comm.connect('configXML',self.process_configXML)
		#create an image cacher thingy
		self.imagecache = ImageCache()
		self.imagecache.set_disabled( self.conf.get_bool_option('no_avatars') )
		self.imagecache.connect('get-widget-image', self.get_widget_image)
	
		#Create notify-er if has pynotify
		if has_pynotify:
			self.notify = Notify()

		#align the window
		self.align_window()
#.........这里部分代码省略.........
开发者ID:yamatt,项目名称:python-hellobuddy,代码行数:103,代码来源:heybuddy.py


注:本文中的Configuration.Configuration.get_bool_option方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。