亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? x6950.htm

?? Its a xmpp protocol book
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
> suffix) resemble email IDs, there doesn't
appear to be that much difference. In any case, CVS doesn't really care,
and simply passes the portion following the colon separator to the 
formula in the <TT
CLASS="FILENAME"
>notify</TT
> file.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="JABTDG-CH-7-SECT-1.3"
>The <TT
CLASS="LITERAL"
>cvsmsg</TT
> notification script</A
></H2
><P
>Let's now have a look at the <TT
CLASS="LITERAL"
>cvsmsg</TT
> script. It
has to send a notification message, which it receives on STDIN, to
a JID, which it receives as an argument passed to the script.</P
><P
><PRE
CLASS="SCREEN"
>import Jabber, XMLStream
import sys&#13;</PRE
></P
><P
>We're going to use the <I
CLASS="EMPHASIS"
>JabberPy</I
> Python libraries
for Jabber
<A
NAME="AEN7118"
HREF="#FTN.AEN7118"
>[3]</A
>
so we import them here. As is the way with many implementations for
Jabber, we find there is a module to handle the XML stream-based connection
with the Jabber server (the <TT
CLASS="LITERAL"
>XMLStream</TT
> module) and
a module to handle the various Jabber connection mechanisms such as 
authentication, the sending of Jabber elements
(<TT
CLASS="LITERAL"
>&#60;message/&#62;</TT
>, 
<TT
CLASS="LITERAL"
>&#60;presence/&#62;</TT
>, 
and <TT
CLASS="LITERAL"
>&#60;iq/&#62;</TT
>),
and the dispatching of Jabber elements received (the 
<TT
CLASS="LITERAL"
>Jabber</TT
> module).
We also import the <TT
CLASS="LITERAL"
>sys</TT
> module for reading from STDIN.</P
><P
>As the usage of the script will be fairly static, we can get away here with
hardcoding a few parameters:</P
><P
><PRE
CLASS="SCREEN"
>Server   = 'gnu.pipetree.com'
Username = 'cvsmsg'
Password = 'secret'
Resource = 'cvsmsg'&#13;</PRE
></P
><P
>Specified here are the connection and authentication details for the
<TT
CLASS="LITERAL"
>cvsmsg</TT
> script itself. If it's to send a message via
Jabber, it must itself connect to Jabber. The <TT
CLASS="LITERAL"
>Server</TT
>
variable specifies which Jabber server to connect to, and the
<TT
CLASS="LITERAL"
>Username</TT
>, <TT
CLASS="LITERAL"
>Password</TT
>, and
<TT
CLASS="LITERAL"
>Resource</TT
> variables contain the rest of the information
for the script's own JID (<TT
CLASS="LITERAL"
>cvsmsg@gnu.pipetree.com/cvsmsg</TT
>)
and password.</P
><P
><PRE
CLASS="SCREEN"
>cvsuser  = sys.argv[1]
message  = ''

for line in sys.stdin.readlines(): message = message + line&#13;</PRE
></P
><P
>The <TT
CLASS="LITERAL"
>sys.argv[1]</TT
> refers to the notification recipient's
JID, which will be specified by the CVS notification mechanism, as it is
substituted for the <TT
CLASS="LITERAL"
>%s</TT
> in the <TT
CLASS="FILENAME"
>notify</TT
>
file's formula. This is saved in the <TT
CLASS="LITERAL"
>cvsuser</TT
> variable.
We then build up the content of our message body we're going to send via
Jabber by reading what's available on STDIN. Typically this will look 
like what we saw in the email message body in
<A
HREF="x6950.htm#JABTDG-CH-7-FIG-1"
>Figure 7-1</A
>:</P
><P
><PRE
CLASS="SCREEN"
>testproject file4
---
Triggered edit watch on /usr/local/cvsroot/testproject
By piers</PRE
></P
><P
><PRE
CLASS="SCREEN"
>con = Jabber.Connection(host=Server)&#13;</PRE
></P
><P
>Although it is the <TT
CLASS="LITERAL"
>XMLStream</TT
> module that handles
the connection to the Jabber server, we are shielded from the details
of this by the <TT
CLASS="LITERAL"
>Jabber</TT
> module that wraps and uses
<TT
CLASS="LITERAL"
>XMLStream</TT
>. Hence the call to instantiate a new
<TT
CLASS="LITERAL"
>Jabber.Connection</TT
> object into <TT
CLASS="LITERAL"
>con</TT
>,
to lay the way for our connection to the host specified in our Server
variable: 
<TT
CLASS="LITERAL"
>gnu.pipetree.com</TT
>. No port is explicitly specified 
here, and the method assumes a default port of 5222, on which the
<I
CLASS="EMPHASIS"
>c2s</I
> service listens.</P
><P
>The instantiation causes a number of parameters and variables to be
initialized, and an <TT
CLASS="LITERAL"
>XMLStream.Client</TT
> object is 
instantiated; various parameters are passed through from the
<TT
CLASS="LITERAL"
>Jabber.Connection</TT
> object (for example for logging
and debugging purposes) and an XML parser object is instantiated. 
This will be used to parse fragments of XML that come in over the
XML stream.</P
><P
><PRE
CLASS="SCREEN"
>try:
    con.connect()
except XMLStream.error, e:
    print "Couldn't connect: %s" % e 
    sys.exit(0)&#13;</PRE
></P
><P
>A connection is attempted with the <TT
CLASS="LITERAL"
>connect()</TT
> method
of the connection object in <TT
CLASS="LITERAL"
>con</TT
>. This is serviced by
the <TT
CLASS="LITERAL"
>XMLStream.Client</TT
> object and a stream header, as
described in <A
HREF="x3837.htm"
>the section called <I
>XML Streams</I
> in Chapter 5</A
>, is sent to 
<TT
CLASS="LITERAL"
>gnu.pipetree.com:5222</TT
> in an a attempt to establish a
client connection.</P
><P
>XMLStream will raise an error if the connection cannot be established, we
trap this, after a fashion, with the <TT
CLASS="LITERAL"
>try: ... except</TT
>
shown here.</P
><P
><PRE
CLASS="SCREEN"
>con.auth(Username,Password,Resource)</PRE
></P
><P
>Once we're connected&mdash;our client has successfully exchanged XML
stream headers with the server&mdash;we need to authenticate. The
<TT
CLASS="LITERAL"
>auth</TT
> method of the <TT
CLASS="LITERAL"
>Jabber.Connection</TT
>
object provides us with a simple way of carrying out the authentication
negotiation, qualified with the <TT
CLASS="LITERAL"
>jabber:iq:auth</TT
> namespace
and described in detail in <A
HREF="x6569.htm"
>the section called <I
>User Authentication</I
> in Chapter 6</A
>.
Although we supply our password here in the script in plaintext
('<TT
CLASS="LITERAL"
>secret</TT
>'), the <TT
CLASS="LITERAL"
>auth</TT
> method will
use the IQ-get (<TT
CLASS="LITERAL"
>&#60;iq type='get'...&#62;</TT
>) to retrieve 
a list of authentication methods supported by the server. It will try and
use the most secure, "gracefully degrading" to the least, until it finds 
one that is supported.
<A
NAME="AEN7180"
HREF="#FTN.AEN7180"
>[4]</A
></P
><P
>Note the presence of the <TT
CLASS="LITERAL"
>resource</TT
> in the call. This 
is required for a successful client authentication regardless of the 
authentication method. Sending an IQ-set
(<TT
CLASS="LITERAL"
>&#60;iq type='set'...&#62;</TT
>)
in the <TT
CLASS="LITERAL"
>jabber:iq:auth</TT
> namespace without 
specifying a value in a<TT
CLASS="LITERAL"
>&#60;resource/&#62;</TT
> tag
results in a "Not Acceptable" error 406; see <A
HREF="x4089.htm#JABTDG-CH-5-TAB-3"
>Table 5-3</A
>
for a list of standard error codes and texts.</P
><P
>We're connected, and authenticated. The world is now our lobster, as
an old friend used to say. We're not necessarily <I
CLASS="EMPHASIS"
>expecting</I
>
to receive anything at this stage, and even if we did, we wouldn't really
want to do anything with what we received anyway. At least at this stage.
So we don't bother setting up any mechanism for handling elements that
might appear on the stream. </P
><P
><PRE
CLASS="SCREEN"
>con.send(Jabber.Message(cvsuser, message, subject="CVS Watch Alarm"))</PRE
></P
><P
>All we do is send the notification message, in the <TT
CLASS="LITERAL"
>message</TT
>
variable, to the user that was specified as an argument when the script
was invoked, stored in the <TT
CLASS="LITERAL"
>cvsuser</TT
> variable. 
There are actually two calls here. The
innermost&mdash;<TT
CLASS="LITERAL"
>Jabber.Message()</TT
>&mdash;creates a simple
message element that looks like this:</P
><P
><PRE
CLASS="SCREEN"
>&#60;message to='[value in cvsuser variable]'&#62;
  &#60;subject&#62;CVS Watch Alarm&#60;/subject&#62;
  &#60;body&#62;[value in message variable]&#60;/body&#62;
&#60;/message&#62;</PRE
></P
><P
>It takes two positional (and required) parameters; any other information
to be passed (such as the <TT
CLASS="LITERAL"
>subject</TT
> in this example)
must be supplied as <I
CLASS="EMPHASIS"
>key=value</I
> pairs.
The outermost&mdash;<TT
CLASS="LITERAL"
>con.send()</TT
>&mdash; sends whatever
it is given over the XML stream that the <TT
CLASS="LITERAL"
>Jabber.Connection</TT
>
object <TT
CLASS="LITERAL"
>con</TT
> represents. In the case of the 
<TT
CLASS="LITERAL"
>Jabber.Message</TT
> call, this is the string representation
of the object so created&mdash;i.e. our
<TT
CLASS="LITERAL"
>&#60;message/&#62;</TT
> element.</P
><P
>Once the notification message has been sent, the script's work is done. 
We can therefore disconnect from the server before exiting the script.</P
><P
><PRE
CLASS="SCREEN"
>con.disconnect()</PRE
></P
><P
>Calling the <TT
CLASS="LITERAL"
>disconnect()</TT
> method of the 
<TT
CLASS="LITERAL"
>Jabber.Connection</TT
> sends an 
<I
CLASS="EMPHASIS"
>unavailable</I
> presence element to the server
on behalf of the user that is connected:</P
><P
><PRE
CLASS="SCREEN"
>&#60;presence type='unavailable'/&#62;</PRE
></P
><P
>This is sent regardless of whether a 
<TT
CLASS="LITERAL"
>&#60;presence/&#62;</TT
> element was sent during the
conversation, but does no harm if one wasn't.</P
><P
>After sending the unavailable presence information, theXML stream is 
closed by sending the stream's closing tag:</P
><P
><PRE
CLASS="SCREEN"
>&#60;/stream:stream&#62;</PRE
></P
><P
>This signifes to the server that the client wishes to end the
conversation. Finally, the socket is closed.</P
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="JABTDG-CH-7-SECT-1.3.2"
>The script in its entirety</A
></H3
><P
>Here's the script in its entirety.</P
><P
><PRE
CLASS="SCREEN"
>import Jabber, XMLStream
import sys

Server   = 'gnu.pipetree.com'
Username = 'cvsmsg'
Password = 'secret'
Resource = 'cvsmsg'

cvsuser  = sys.argv[1]
message  = ''

for line in sys.stdin.readlines(): message = message + line

con = Jabber.Connection(host=Server)

try:
    con.connect()
except XMLStream.error, e:
    print "Couldn't connect: %s" % e 
    sys.exit(0)

con.auth(Username,Password,Resource)
con.send(Jabber.Message(cvsuser, message, subject="CVS Watch Alarm"))
con.disconnect()</PRE
></P
></DIV
></DIV
></DIV
><H3
CLASS="FOOTNOTES"
>Notes</H3
><TABLE
BORDER="0"
CLASS="FOOTNOTES"
WIDTH="100%"
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN6953"
HREF="x6950.htm#AEN6953"
>[1]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>You can find out more about CVS at
<A
HREF="http://www.cvshome.org"
TARGET="_top"
>http://www.cvshome.org</A
>.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN6956"
HREF="x6950.htm#AEN6956"
>[2]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
><A
HREF="http://www.docbook.org"
TARGET="_top"
>http://www.docbook.org</A
>.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN7118"
HREF="x6950.htm#AEN7118"
>[3]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>http://sourceforge.net/projects/jabberpy/
available at <A
HREF="http://sourceforge.net/projects/jabberpy/"
TARGET="_top"
>http://sourceforge.net/projects/jabberpy/</A
></P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN7180"
HREF="x6950.htm#AEN7180"
>[4]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>This degradation typically will follow the pattern
"<I
CLASS="EMPHASIS"
>zero-knowledge</I
> supported? No. 
Ok. How about <I
CLASS="EMPHASIS"
>digest</I
>? No? Ok. Then how about 
<I
CLASS="EMPHASIS"
>plaintext</I
>? No? Oh dear. This isn't going to work."</P
></TD
></TR
></TABLE
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="c6941.htm"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.htm"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x7229.htm"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Messages, Presence, and Presence Subscription</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c6941.htm"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Dialup system watch</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠色伊人亚洲综合成人| 欧美精品久久一区| 欧美日韩一区小说| 国产日韩综合av| 美女视频一区在线观看| 日本丶国产丶欧美色综合| 精品国产sm最大网站免费看| 亚洲综合视频在线观看| 成人丝袜18视频在线观看| 精品精品国产高清a毛片牛牛| 亚洲综合无码一区二区| 91网站最新地址| 国产肉丝袜一区二区| 国产综合久久久久久鬼色| 欧美一区二区在线观看| 视频一区二区中文字幕| 欧美三级中文字| 亚洲综合免费观看高清完整版 | 91精品国产综合久久精品app| 国产精品乱码一区二三区小蝌蚪| 国内精品第一页| 欧美精品九九99久久| 亚洲综合色在线| 91黄色小视频| 亚洲在线成人精品| 91福利区一区二区三区| 亚洲一区二区视频在线观看| 91在线无精精品入口| 国产精品国产a级| 国产乱一区二区| 国产欧美精品一区二区三区四区| 激情综合色综合久久| 国产午夜精品一区二区| 国产ts人妖一区二区| 国产精品乱码一区二区三区软件 | 日本中文字幕一区二区视频| 欧美日韩一区二区不卡| 日韩精品欧美精品| 欧美一区二区三区婷婷月色| 久久成人久久爱| 国产欧美视频在线观看| 99热在这里有精品免费| 一区二区三区欧美日韩| 91搞黄在线观看| 午夜精品福利久久久| 日韩免费高清av| 成人精品视频一区二区三区 | 日本va欧美va欧美va精品| 91麻豆精品国产91久久久久久| 亚欧色一区w666天堂| 日韩欧美综合一区| 国产综合色产在线精品 | 久久精品欧美日韩精品| 粉嫩av一区二区三区| 亚洲激情欧美激情| 亚洲欧洲av在线| 91一区二区在线| 日韩精品久久理论片| 欧美国产精品一区二区三区| 成人18视频日本| 亚洲超丰满肉感bbw| 欧美精品一区二区三| www.欧美精品一二区| 日韩国产欧美视频| 欧美激情一区二区三区在线| 欧美视频一区二区三区| 黑人巨大精品欧美黑白配亚洲| 久久精品国产精品青草| 中文字幕欧美国产| 欧美日韩精品免费观看视频| 久久99这里只有精品| 一区二区三区四区不卡视频| 精品女同一区二区| 色综合久久久久综合| 国产乱码精品一区二区三| 五月天婷婷综合| 国产精品乱码一区二区三区软件| 欧美一级黄色片| 色婷婷av一区| 国产精品一级二级三级| 天堂成人免费av电影一区| 亚洲天天做日日做天天谢日日欢| 欧美大胆一级视频| 欧美三级视频在线观看| 99久久国产综合精品色伊| 国产一区二区三区久久久| 图片区小说区国产精品视频| 亚洲日本在线视频观看| 国产精品无码永久免费888| 欧美电影免费观看高清完整版在| 欧美色窝79yyyycom| 99精品国产99久久久久久白柏| 国产一区二区三区免费观看| 秋霞成人午夜伦在线观看| 亚洲精品视频在线观看网站| 国产精品久久精品日日| 久久亚洲捆绑美女| 精品国一区二区三区| 日韩一本二本av| 91精品国产色综合久久不卡蜜臀 | 99久久夜色精品国产网站| 国产精品一区在线| 国产一区二区在线视频| 经典三级在线一区| 久久er精品视频| 久久se这里有精品| 精品写真视频在线观看| 国产一区二区三区视频在线播放| 久久av中文字幕片| 国产一区在线观看视频| 国产麻豆精品theporn| 黄色资源网久久资源365| 国产精选一区二区三区| 国产精品一区二区果冻传媒| 国产成人免费xxxxxxxx| 成人91在线观看| 91一区一区三区| 色综合视频在线观看| 欧美色综合久久| 制服.丝袜.亚洲.中文.综合| 日韩一区二区三区精品视频 | 国产精品99精品久久免费| 国产·精品毛片| 99国产精品久| 欧美三级资源在线| 日韩一区二区在线看| 国产亚洲精品bt天堂精选| 国产精品美女视频| 亚洲与欧洲av电影| 看片的网站亚洲| 国产99一区视频免费| 91网站最新地址| 欧美一区二区三区四区在线观看 | 日韩欧美在线一区二区三区| 欧美一区二区三区白人 | 精品国产免费一区二区三区四区| 精品噜噜噜噜久久久久久久久试看| 久久人人超碰精品| 亚洲欧美综合网| 日韩avvvv在线播放| 国产成人丝袜美腿| 欧美怡红院视频| 久久在线观看免费| 亚洲精品国产精华液| 色综合天天综合网天天狠天天| 日本道在线观看一区二区| 欧美一区二区不卡视频| 中文在线免费一区三区高中清不卡 | 亚洲欧美一区二区久久| 午夜精品久久久久久久久| 国产精品主播直播| 欧美日韩国产色站一区二区三区| 久久综合五月天婷婷伊人| 亚洲天堂2016| 久久电影网电视剧免费观看| 92国产精品观看| 久久久久久免费| 亚洲尤物视频在线| 懂色av噜噜一区二区三区av | 91官网在线观看| 欧美国产一区视频在线观看| 亚洲成人免费在线| 不卡区在线中文字幕| 日韩手机在线导航| 亚洲永久免费视频| 国产不卡在线播放| 4438x亚洲最大成人网| 中文字幕日本乱码精品影院| 麻豆精品视频在线观看视频| 在线观看精品一区| 国产精品成人免费在线| 国产精品影视在线| 欧美一级视频精品观看| 一区二区三区四区不卡视频| 成人免费看视频| 国产日韩欧美麻豆| 久久99久久久欧美国产| 欧美浪妇xxxx高跟鞋交| 亚洲黄色免费网站| 不卡一区在线观看| 中文字幕巨乱亚洲| 国产麻豆一精品一av一免费| 欧美xxxx在线观看| 亚洲va国产天堂va久久en| 色狠狠色狠狠综合| 亚洲啪啪综合av一区二区三区| 成人永久aaa| 国产精品久久久久久久第一福利 | 337p亚洲精品色噜噜噜| 亚洲风情在线资源站| 在线中文字幕一区二区| 亚洲激情自拍偷拍| 在线观看国产日韩| 亚洲高清一区二区三区| 日本道免费精品一区二区三区| 亚洲激情图片小说视频| 欧美性色欧美a在线播放| 亚洲国产视频网站| 欧美日韩精品久久久| 日本午夜精品视频在线观看 |