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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? mailer.py

?? subversion-1.4.5.tar.gz 配置svn的源碼
?? PY
?? 第 1 頁 / 共 3 頁
字號(hào):
#!/usr/bin/env python## mailer.py: send email describing a commit## $HeadURL: http://svn.collab.net/repos/svn/branches/1.4.x/tools/hook-scripts/mailer/mailer.py $# $LastChangedDate: 2006-09-11 18:00:53 +0000 (Mon, 11 Sep 2006) $# $LastChangedBy: dlr $# $LastChangedRevision: 21431 $## USAGE: mailer.py commit      REPOS REVISION [CONFIG-FILE]#        mailer.py propchange  REPOS REVISION AUTHOR REVPROPNAME [CONFIG-FILE]#        mailer.py propchange2 REPOS REVISION AUTHOR REVPROPNAME ACTION \#                              [CONFIG-FILE]#        mailer.py lock        REPOS AUTHOR [CONFIG-FILE]#        mailer.py unlock      REPOS AUTHOR [CONFIG-FILE]##   Using CONFIG-FILE, deliver an email describing the changes between#   REV and REV-1 for the repository REPOS.##   ACTION was added as a fifth argument to the post-revprop-change hook#   in Subversion 1.2.0.  Its value is one of 'A', 'M' or 'D' to indicate#   if the property was added, modified or deleted, respectively.##   This version of mailer.py requires the python bindings from#   subversion 1.2.0 or later.#import osimport sysimport stringimport ConfigParserimport timeimport popen2import cStringIOimport smtplibimport reimport tempfileimport typesimport urllibimport svn.fsimport svn.deltaimport svn.reposimport svn.coreSEPARATOR = '=' * 78def main(pool, cmd, config_fname, repos_dir, cmd_args):  ### TODO:  Sanity check the incoming args  if cmd == 'commit':    revision = int(cmd_args[0])    repos = Repository(repos_dir, revision, pool)    cfg = Config(config_fname, repos, { 'author' : repos.author })    messenger = Commit(pool, cfg, repos)  elif cmd == 'propchange' or cmd == 'propchange2':    revision = int(cmd_args[0])    author = cmd_args[1]    propname = cmd_args[2]    action = (cmd == 'propchange2' and cmd_args[3] or 'A')    repos = Repository(repos_dir, revision, pool)    # Override the repos revision author with the author of the propchange    repos.author = author    cfg = Config(config_fname, repos, { 'author' : author })    messenger = PropChange(pool, cfg, repos, author, propname, action)  elif cmd == 'lock' or cmd == 'unlock':    author = cmd_args[0]    repos = Repository(repos_dir, 0, pool) ### any old revision will do    # Override the repos revision author with the author of the lock/unlock    repos.author = author    cfg = Config(config_fname, repos, { 'author' : author })    messenger = Lock(pool, cfg, repos, author, cmd == 'lock')  else:    raise UnknownSubcommand(cmd)  messenger.generate()# Minimal, incomplete, versions of popen2.Popen[34] for those platforms# for which popen2 does not provide them.try:  Popen3 = popen2.Popen3  Popen4 = popen2.Popen4except AttributeError:  class Popen3:    def __init__(self, cmd, capturestderr = False):      if type(cmd) != types.StringType:        cmd = svn.core.argv_to_command_string(cmd)      if capturestderr:        self.fromchild, self.tochild, self.childerr \            = popen2.popen3(cmd, mode='b')      else:        self.fromchild, self.tochild = popen2.popen2(cmd, mode='b')        self.childerr = None    def wait(self):      rv = self.fromchild.close()      rv = self.tochild.close() or rv      if self.childerr is not None:        rv = self.childerr.close() or rv      return rv  class Popen4:    def __init__(self, cmd):      if type(cmd) != types.StringType:        cmd = svn.core.argv_to_command_string(cmd)      self.fromchild, self.tochild = popen2.popen4(cmd, mode='b')    def wait(self):      rv = self.fromchild.close()      rv = self.tochild.close() or rv      return rvclass OutputBase:  "Abstract base class to formalize the inteface of output methods"  def __init__(self, cfg, repos, prefix_param):    self.cfg = cfg    self.repos = repos    self.prefix_param = prefix_param    self._CHUNKSIZE = 128 * 1024    # This is a public member variable. This must be assigned a suitable    # piece of descriptive text before make_subject() is called.    self.subject = ""  def make_subject(self, group, params):    prefix = self.cfg.get(self.prefix_param, group, params)    if prefix:      subject = prefix + ' ' + self.subject    else:      subject = self.subject    try:      truncate_subject = int(          self.cfg.get('truncate_subject', group, params))    except ValueError:      truncate_subject = 0    if truncate_subject and len(subject) > truncate_subject:      subject = subject[:(truncate_subject - 3)] + "..."    return subject  def start(self, group, params):    """Override this method.    Begin writing an output representation. GROUP is the name of the    configuration file group which is causing this output to be produced.    PARAMS is a dictionary of any named subexpressions of regular expressions    defined in the configuration file, plus the key 'author' contains the    author of the action being reported."""    raise NotImplementedError  def finish(self):    """Override this method.    Flush any cached information and finish writing the output    representation."""    raise NotImplementedError  def write(self, output):    """Override this method.    Append the literal text string OUTPUT to the output representation."""    raise NotImplementedError  def run(self, cmd):    """Override this method, if the default implementation is not sufficient.    Execute CMD, writing the stdout produced to the output representation."""    # By default we choose to incorporate child stderr into the output    pipe_ob = Popen4(cmd)    buf = pipe_ob.fromchild.read(self._CHUNKSIZE)    while buf:      self.write(buf)      buf = pipe_ob.fromchild.read(self._CHUNKSIZE)    # wait on the child so we don't end up with a billion zombies    pipe_ob.wait()class MailedOutput(OutputBase):  def __init__(self, cfg, repos, prefix_param):    OutputBase.__init__(self, cfg, repos, prefix_param)  def start(self, group, params):    # whitespace-separated list of addresses; split into a clean list:    self.to_addrs = \        filter(None, string.split(self.cfg.get('to_addr', group, params)))    self.from_addr = self.cfg.get('from_addr', group, params) \                     or self.repos.author or 'no_author'    self.reply_to = self.cfg.get('reply_to', group, params)  def mail_headers(self, group, params):    subject = self.make_subject(group, params)    try:      subject.encode('ascii')    except UnicodeError:      from email.Header import Header      subject = Header(subject, 'utf-8').encode()    hdrs = 'From: %s\n'    \           'To: %s\n'      \           'Subject: %s\n' \           'MIME-Version: 1.0\n' \           'Content-Type: text/plain; charset=UTF-8\n' \           'Content-Transfer-Encoding: 8bit\n' \           % (self.from_addr, string.join(self.to_addrs, ', '), subject)    if self.reply_to:      hdrs = '%sReply-To: %s\n' % (hdrs, self.reply_to)    return hdrs + '\n'class SMTPOutput(MailedOutput):  "Deliver a mail message to an MTA using SMTP."  def start(self, group, params):    MailedOutput.start(self, group, params)    self.buffer = cStringIO.StringIO()    self.write = self.buffer.write    self.write(self.mail_headers(group, params))  def finish(self):    server = smtplib.SMTP(self.cfg.general.smtp_hostname)    if self.cfg.is_set('general.smtp_username'):      server.login(self.cfg.general.smtp_username,                   self.cfg.general.smtp_password)    server.sendmail(self.from_addr, self.to_addrs, self.buffer.getvalue())    server.quit()class StandardOutput(OutputBase):  "Print the commit message to stdout."  def __init__(self, cfg, repos, prefix_param):    OutputBase.__init__(self, cfg, repos, prefix_param)    self.write = sys.stdout.write  def start(self, group, params):    self.write("Group: " + (group or "defaults") + "\n")    self.write("Subject: " + self.make_subject(group, params) + "\n\n")  def finish(self):    passclass PipeOutput(MailedOutput):  "Deliver a mail message to an MTA via a pipe."  def __init__(self, cfg, repos, prefix_param):    MailedOutput.__init__(self, cfg, repos, prefix_param)    # figure out the command for delivery    self.cmd = string.split(cfg.general.mail_command)  def start(self, group, params):    MailedOutput.start(self, group, params)    ### gotta fix this. this is pretty specific to sendmail and qmail's    ### mailwrapper program. should be able to use option param substitution    cmd = self.cmd + [ '-f', self.from_addr ] + self.to_addrs    # construct the pipe for talking to the mailer    self.pipe = Popen3(cmd)    self.write = self.pipe.tochild.write    # we don't need the read-from-mailer descriptor, so close it    self.pipe.fromchild.close()    # start writing out the mail message    self.write(self.mail_headers(group, params))  def finish(self):    # signal that we're done sending content    self.pipe.tochild.close()    # wait to avoid zombies    self.pipe.wait()class Messenger:  def __init__(self, pool, cfg, repos, prefix_param):    self.pool = pool    self.cfg = cfg    self.repos = repos    if cfg.is_set('general.mail_command'):      cls = PipeOutput    elif cfg.is_set('general.smtp_hostname'):      cls = SMTPOutput    else:      cls = StandardOutput    self.output = cls(cfg, repos, prefix_param)class Commit(Messenger):  def __init__(self, pool, cfg, repos):    Messenger.__init__(self, pool, cfg, repos, 'commit_subject_prefix')    # get all the changes and sort by path    editor = svn.repos.ChangeCollector(repos.fs_ptr, repos.root_this, self.pool)    e_ptr, e_baton = svn.delta.make_editor(editor, self.pool)    svn.repos.replay(repos.root_this, e_ptr, e_baton, self.pool)    self.changelist = editor.get_changes().items()    self.changelist.sort()    # collect the set of groups and the unique sets of params for the options    self.groups = { }    for path, change in self.changelist:      for (group, params) in self.cfg.which_groups(path):        # turn the params into a hashable object and stash it away        param_list = params.items()        param_list.sort()        # collect the set of paths belonging to this group        if self.groups.has_key( (group, tuple(param_list)) ):          old_param, paths = self.groups[group, tuple(param_list)]        else:          paths = { }        paths[path] = None        self.groups[group, tuple(param_list)] = (params, paths)    # figure out the changed directories    dirs = { }    for path, change in self.changelist:      if change.item_kind == svn.core.svn_node_dir:        dirs[path] = None      else:        idx = string.rfind(path, '/')        if idx == -1:          dirs[''] = None        else:          dirs[path[:idx]] = None    dirlist = dirs.keys()    commondir, dirlist = get_commondir(dirlist)    # compose the basic subject line. later, we can prefix it.    dirlist.sort()    dirlist = string.join(dirlist)    if commondir:      self.output.subject = 'r%d - in %s: %s' % (repos.rev, commondir, dirlist)    else:      self.output.subject = 'r%d - %s' % (repos.rev, dirlist)  def generate(self):    "Generate email for the various groups and option-params."    ### the groups need to be further compressed. if the headers and    ### body are the same across groups, then we can have multiple To:    ### addresses. SMTPOutput holds the entire message body in memory,    ### so if the body doesn't change, then it can be sent N times    ### rather than rebuilding it each time.    subpool = svn.core.svn_pool_create(self.pool)    # build a renderer, tied to our output stream    renderer = TextCommitRenderer(self.output)    for (group, param_tuple), (params, paths) in self.groups.items():      self.output.start(group, params)      # generate the content for this group and set of params      generate_content(renderer, self.cfg, self.repos, self.changelist,                       group, params, paths, subpool)      self.output.finish()      svn.core.svn_pool_clear(subpool)    svn.core.svn_pool_destroy(subpool)try:  from tempfile import NamedTemporaryFileexcept ImportError:  # NamedTemporaryFile was added in Python 2.3, so we need to emulate it  # for older Pythons.  class NamedTemporaryFile:    def __init__(self):      self.name = tempfile.mktemp()      self.file = open(self.name, 'w+b')    def __del__(self):      os.remove(self.name)    def write(self, data):      self.file.write(data)    def flush(self):      self.file.flush()class PropChange(Messenger):  def __init__(self, pool, cfg, repos, author, propname, action):    Messenger.__init__(self, pool, cfg, repos, 'propchange_subject_prefix')    self.author = author    self.propname = propname    self.action = action    # collect the set of groups and the unique sets of params for the options    self.groups = { }    for (group, params) in self.cfg.which_groups(''):      # turn the params into a hashable object and stash it away      param_list = params.items()      param_list.sort()      self.groups[group, tuple(param_list)] = params    self.output.subject = 'r%d - %s' % (repos.rev, propname)  def generate(self):    actions = { 'A': 'added', 'M': 'modified', 'D': 'deleted' }    for (group, param_tuple), params in self.groups.items():      self.output.start(group, params)      self.output.write('Author: %s\n'                        'Revision: %s\n'                        'Property Name: %s\n'                        'Action: %s\n'                        '\n'                        % (self.author, self.repos.rev, self.propname,                           actions.get(self.action, 'Unknown (\'%s\')' \                                       % self.action)))      if self.action == 'A' or not actions.has_key(self.action):        self.output.write('Property value:\n')        propvalue = self.repos.get_rev_prop(self.propname)        self.output.write(propvalue)      elif self.action == 'M':        self.output.write('Property diff:\n')        tempfile1 = NamedTemporaryFile()        tempfile1.write(sys.stdin.read())        tempfile1.flush()        tempfile2 = NamedTemporaryFile()        tempfile2.write(self.repos.get_rev_prop(self.propname))        tempfile2.flush()        self.output.run(self.cfg.get_diff_cmd(group, {          'label_from' : 'old property value',          'label_to' : 'new property value',          'from' : tempfile1.name,          'to' : tempfile2.name,          }))      self.output.finish()def get_commondir(dirlist):

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩高清在线观看| 国产精品国产精品国产专区不蜜| 五月天婷婷综合| 欧美激情一区在线| 精品成a人在线观看| 欧美性生活影院| 韩国理伦片一区二区三区在线播放| 中文字幕成人网| 在线电影院国产精品| 91久久国产最好的精华液| 国产v日产∨综合v精品视频| 大美女一区二区三区| 国产精品一区一区| 久久成人免费日本黄色| 日韩精品国产精品| 久久国产精品色婷婷| 国精产品一区一区三区mba视频| 亚洲欧美另类久久久精品 | 久久日一线二线三线suv| 国产在线麻豆精品观看| 精品中文字幕一区二区小辣椒 | 欧美mv和日韩mv的网站| 欧美一区二区三区男人的天堂| 欧美性色欧美a在线播放| 国产婷婷色一区二区三区| 婷婷综合久久一区二区三区| 色综合久久久久久久| 国产丝袜美腿一区二区三区| 亚洲人成人一区二区在线观看 | 日本韩国精品一区二区在线观看| 成人永久aaa| 日韩欧美一区在线观看| 国产视频亚洲色图| 麻豆精品久久精品色综合| 成人精品国产一区二区4080| 欧美精品一区二区三区久久久| 一区二区三区在线免费视频| jlzzjlzz欧美大全| 91福利国产精品| 欧美精选午夜久久久乱码6080| 精品捆绑美女sm三区| 国产精品成人在线观看| 日韩中文字幕1| 成人av资源下载| 欧美性色黄大片手机版| 欧美大片拔萝卜| 日本伊人色综合网| 91精品久久久久久久99蜜桃| 日日噜噜夜夜狠狠视频欧美人| 99精品视频在线免费观看| 精品1区2区在线观看| 亚洲成a天堂v人片| 色综合久久综合| 国产精品国产自产拍高清av王其| 成人午夜在线视频| 亚洲国产成人porn| 99久久99久久综合| 中文字幕欧美日韩一区| 免费看日韩精品| 国产校园另类小说区| 国产一区视频在线看| 欧美国产日韩在线观看| 91在线无精精品入口| 亚洲一区免费观看| 精品国产乱码久久久久久老虎 | 亚洲欧洲精品一区二区三区不卡| 一本一道久久a久久精品综合蜜臀| 亚洲激情一二三区| 久久天天做天天爱综合色| 欧美日本在线视频| 国产另类ts人妖一区二区| 一区二区三国产精华液| 国产亚洲1区2区3区| 欧美日韩一级大片网址| 欧美性猛交xxxxxxxx| 国产一区二区在线影院| 亚洲综合男人的天堂| 国产精品毛片a∨一区二区三区| 欧美日本一区二区三区| www..com久久爱| 精品一区二区免费看| 婷婷六月综合亚洲| 亚洲欧美经典视频| ...av二区三区久久精品| 久久亚洲精精品中文字幕早川悠里| 在线观看免费成人| 91成人网在线| 亚洲视频精选在线| 日韩一区二区视频| 欧美电影免费观看完整版| 欧美三级日韩三级国产三级| 欧美精品视频www在线观看| 久久久亚洲国产美女国产盗摄| 中文字幕中文字幕一区| 久久国产尿小便嘘嘘尿| 91色九色蝌蚪| 久久久91精品国产一区二区三区| 亚洲成人一区二区| 99免费精品在线| 亚洲国产精品ⅴa在线观看| 日韩av一级电影| 欧美精品久久99久久在免费线| 亚洲乱码国产乱码精品精的特点 | 五月综合激情网| 久久精品99国产精品日本| 国产大陆精品国产| 欧美一区二区三区视频在线观看| 欧美国产一区视频在线观看| 亚洲制服丝袜av| www.日韩精品| 久久亚洲精品小早川怜子| 一区二区三区在线观看网站| 黄页网站大全一区二区| 在线精品视频一区二区| 国产日产精品1区| 精品在线播放午夜| 91精品国产综合久久婷婷香蕉 | 成人国产精品免费观看动漫| 91精品国产乱| 亚洲成人动漫av| 欧美亚洲禁片免费| 亚洲一区二区免费视频| 91视频.com| 一区二区三区在线视频观看| 国产jizzjizz一区二区| 精品三级av在线| 国产乱码精品一区二区三区五月婷| 欧美一区二区精品在线| 亚洲国产日韩a在线播放性色| 欧美三级三级三级爽爽爽| 亚洲成人免费看| 91精品国产一区二区人妖| 国产精品一线二线三线| 处破女av一区二区| 欧美在线免费视屏| 亚洲人成精品久久久久| 久久精品久久99精品久久| 岛国精品在线观看| 成人免费看的视频| 777色狠狠一区二区三区| 日韩一区二区免费在线电影| 图片区小说区国产精品视频| 欧美日韩免费在线视频| 日韩影院免费视频| 欧美视频在线一区| 国产免费久久精品| 蜜臀久久99精品久久久久久9| 天天综合色天天综合色h| 北岛玲一区二区三区四区| 亚洲日穴在线视频| 久久成人免费电影| 欧美日韩成人综合| 美女视频黄频大全不卡视频在线播放 | 日韩一区二区三区精品视频 | 欧美一区二区三区爱爱| 国产精品1区2区3区| 亚洲一区在线观看免费观看电影高清| 一本高清dvd不卡在线观看| 蜜臀av国产精品久久久久| 日本一区二区在线不卡| 91精品国产91久久久久久一区二区 | 经典三级一区二区| 一区二区三区成人| 久久蜜桃av一区二区天堂| 欧美人与z0zoxxxx视频| 97久久精品人人做人人爽| 国产一区二区三区久久悠悠色av| 亚洲一区二区三区激情| 国产精品私房写真福利视频| 日韩一区二区麻豆国产| 欧美日韩成人在线| 91蜜桃网址入口| 成人av手机在线观看| 国产91精品精华液一区二区三区| 日韩有码一区二区三区| 亚洲在线视频免费观看| 一区二区三区欧美视频| 亚洲男人电影天堂| 亚洲国产精品一区二区www在线| 亚洲精品日韩一| 亚洲国产你懂的| 日韩一区精品视频| 久久电影国产免费久久电影| 青青草97国产精品免费观看无弹窗版| 亚洲国产aⅴ成人精品无吗| 亚洲18色成人| 奇米精品一区二区三区在线观看| 美女视频一区在线观看| 国产精品一线二线三线精华| av在线这里只有精品| 欧洲激情一区二区| 精品欧美一区二区在线观看| 国产午夜精品久久久久久免费视| 国产无一区二区| 亚洲综合在线电影| 狠狠色丁香婷婷综合久久片| 91网站在线播放| 精品国产电影一区二区| 亚洲日本在线看| 国产精品66部|