當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。