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


Python nntplib.NNTPError方法代码示例

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


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

示例1: test_zlogin

# 需要导入模块: import nntplib [as 别名]
# 或者: from nntplib import NNTPError [as 别名]
def test_zlogin(self):
        # This test must be the penultimate because further commands will be
        # refused.
        baduser = "notarealuser"
        badpw = "notarealpassword"
        # Check that bogus credentials cause failure
        self.assertRaises(nntplib.NNTPError, self.server.login,
                          user=baduser, password=badpw, usenetrc=False)
        # FIXME: We should check that correct credentials succeed, but that
        # would require valid details for some server somewhere to be in the
        # test suite, I think. Gmane is anonymous, at least as used for the
        # other tests. 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:14,代码来源:test_nntplib.py

示例2: test_module_all_attribute

# 需要导入模块: import nntplib [as 别名]
# 或者: from nntplib import NNTPError [as 别名]
def test_module_all_attribute(self):
        self.assertTrue(hasattr(nntplib, '__all__'))
        target_api = ['NNTP', 'NNTPError', 'NNTPReplyError',
                      'NNTPTemporaryError', 'NNTPPermanentError',
                      'NNTPProtocolError', 'NNTPDataError', 'decode_header']
        if ssl is not None:
            target_api.append('NNTP_SSL')
        self.assertEqual(set(nntplib.__all__), set(target_api)) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:10,代码来源:test_nntplib.py

示例3: run

# 需要导入模块: import nntplib [as 别名]
# 或者: from nntplib import NNTPError [as 别名]
def run(self):
		value = getword()
		try:
			print "-"*12
			print "User:",user[:-1],"Password:",value
			n = nntplib.NNTP(ip,119,user,value)
			print "\t\nLogin successful:",user, value
			n.quit()
			work.join()
			sys.exit(2)
		except(nntplib.NNTPError, socket.gaierror, socket.error, socket.herror), msg: 
			print "An error occurred:", msg
			pass 
开发者ID:knightmare2600,项目名称:d4rkc0de,代码行数:15,代码来源:nntpbrute_iprange.py

示例4: run

# 需要导入模块: import nntplib [as 别名]
# 或者: from nntplib import NNTPError [as 别名]
def run(self):
		value = getword()
		try:
			print "-"*12
			print "User:",user[:-1],"Password:",value
			n = nntplib.NNTP(ipaddr[0],119,user,value)
			print "\t\nLogin successful:",user, value
			n.quit()
			work.join()
			sys.exit(2)
		except (nntplib.NNTPError, socket.gaierror, socket.error, socket.herror), msg: 
			#print "An error occurred:", msg
			pass 
开发者ID:knightmare2600,项目名称:d4rkc0de,代码行数:15,代码来源:nntpbrute_random.py

示例5: run

# 需要导入模块: import nntplib [as 别名]
# 或者: from nntplib import NNTPError [as 别名]
def run(self):
		value, user = getword()
		try:
			print "-"*12
			print "User:",user,"Password:",value
			n = nntplib.NNTP(sys.argv[1],int(sys.argv[2]),user,value)
			print "\t\nLogin successful:",value, user
			n.quit()
			work.join()
			sys.exit(2)
		except(nntplib.NNTPError, socket.gaierror, socket.error, socket.herror), msg: 
			print "An error occurred:", msg
			pass 
开发者ID:knightmare2600,项目名称:d4rkc0de,代码行数:15,代码来源:nntpbrute.py


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