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

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

?? mailer.py

?? subversion-1.4.3-1.tar.gz 配置svn的源碼
?? PY
?? 第 1 頁 / 共 3 頁
字號:
#!/usr/bin/env python## mailer.py: send email describing a commit## $HeadURL: https://svn.collab.net/repos/svn/branches/1.4.x/tools/hook-scripts/mailer/mailer.py $# $LastChangedDate: 2006-09-11 13:00:53 -0500 (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):

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美va亚洲va香蕉在线| 成人av一区二区三区| 中文字幕一区视频| 日韩三级.com| 91国偷自产一区二区开放时间| 麻豆精品在线播放| 亚洲午夜在线视频| 最新中文字幕一区二区三区| 欧美videos大乳护士334| 在线观看成人免费视频| 成人免费视频caoporn| 精品一区免费av| 亚洲成人av一区二区三区| 中文字幕一区二区三区在线不卡 | 亚洲一区二区欧美日韩| 国产精品久久久久aaaa樱花| 欧美大片一区二区| 欧美精品亚洲一区二区在线播放| 99久久久久久| 成人h精品动漫一区二区三区| 蜜臀av在线播放一区二区三区| 夜夜精品视频一区二区| 亚洲视频一二三区| 国产精品人成在线观看免费| 久久久久久久久久久黄色| 制服丝袜日韩国产| 欧美浪妇xxxx高跟鞋交| 欧美三级乱人伦电影| 色偷偷久久一区二区三区| 波多野结衣在线一区| 国产成人aaaa| 丁香六月综合激情| 成人v精品蜜桃久久一区| 风间由美一区二区三区在线观看 | 欧美国产日韩一二三区| 国产午夜亚洲精品理论片色戒| 欧美成人官网二区| 日韩精品一区二区三区四区视频| 欧美一区二区三区在线看| 欧美日本一区二区在线观看| 8x福利精品第一导航| 欧美丰满少妇xxxbbb| 欧美电影一区二区| 日韩一区二区精品葵司在线| 日韩欧美国产午夜精品| 日韩欧美一级在线播放| 精品久久久久久久久久久久久久久| 日韩精品一区二区三区在线观看| 久久综合久久鬼色| 国产三级精品在线| 国产精品伦一区| 亚洲欧美日韩一区二区| 亚洲一区二区三区影院| 日韩精品一级中文字幕精品视频免费观看 | 亚洲欧美另类久久久精品| 亚洲欧美另类小说视频| 亚洲图片一区二区| 青青国产91久久久久久| 黑人巨大精品欧美一区| youjizz国产精品| 一本大道久久a久久精二百| 欧美日韩三级视频| 久久伊人蜜桃av一区二区| 国产精品青草久久| 亚洲国产精品久久艾草纯爱| 免费观看久久久4p| 成人三级在线视频| 欧美视频自拍偷拍| 久久亚洲免费视频| 亚洲欧美电影院| 免费成人性网站| 成人福利视频在线看| 欧美专区亚洲专区| 久久影院午夜论| 一区二区三区中文在线| 毛片av一区二区| 成人av免费在线播放| 欧美精品18+| 国产精品视频线看| 日韩精品久久久久久| 岛国av在线一区| 欧美日韩精品一区二区三区| 亚洲成人自拍网| 日av在线不卡| 麻豆91免费看| 亚洲午夜免费电影| 久久av老司机精品网站导航| 国产成人午夜99999| 欧美亚洲丝袜传媒另类| 久久久亚洲高清| 亚洲精品中文字幕乱码三区| 狠狠色丁香九九婷婷综合五月| 色欧美88888久久久久久影院| 久久一夜天堂av一区二区三区| 亚洲女人****多毛耸耸8| 精品午夜一区二区三区在线观看| 一本高清dvd不卡在线观看| 精品国产91亚洲一区二区三区婷婷| 亚洲最大的成人av| 丁香五精品蜜臀久久久久99网站| 在线播放日韩导航| 亚洲男人的天堂在线观看| 国产v综合v亚洲欧| 欧美成人在线直播| 亚洲bt欧美bt精品777| av不卡一区二区三区| 国产日韩精品久久久| 久久综合综合久久综合| 欧美日韩中文字幕一区| 综合激情成人伊人| 国产专区欧美精品| 久久综合九色综合欧美就去吻| 亚洲大尺度视频在线观看| 不卡视频一二三| 久久精品水蜜桃av综合天堂| 久久99精品国产91久久来源| 欧美老女人第四色| 亚洲亚洲精品在线观看| 欧美在线观看视频一区二区| 亚洲欧美日韩国产一区二区三区| 成人午夜在线视频| 久久亚区不卡日本| 国产一区二区中文字幕| 日韩色在线观看| 免费欧美在线视频| 日韩欧美国产精品| 日本不卡的三区四区五区| 欧美精品乱人伦久久久久久| 亚洲福利视频一区二区| 色婷婷精品久久二区二区蜜臀av| 亚洲女爱视频在线| 欧美最猛黑人xxxxx猛交| 一卡二卡三卡日韩欧美| 欧美在线观看一区二区| 亚洲国产日产av| 欧美三电影在线| 日韩av中文在线观看| 91精品国产欧美一区二区18| 蜜臀av性久久久久蜜臀aⅴ| 欧美一区二区成人| 精品综合久久久久久8888| 2020国产精品自拍| 高潮精品一区videoshd| 中文字幕免费在线观看视频一区| 成人激情文学综合网| 亚洲乱码中文字幕| 欧美艳星brazzers| 日本不卡视频在线观看| 2020国产精品自拍| 成人网在线播放| 亚洲一区中文日韩| 欧美一卡2卡3卡4卡| 国产精品自拍毛片| 国产精品系列在线| 欧美这里有精品| 蜜乳av一区二区三区| 91激情五月电影| 午夜精品久久久久久久蜜桃app| 这里只有精品免费| 国内精品写真在线观看| 国产精品日韩成人| 欧美日韩免费观看一区三区| 蜜臀va亚洲va欧美va天堂| 久久九九全国免费| 91视频国产资源| 午夜精品福利在线| 久久综合久久鬼色| 一本久道久久综合中文字幕| 日本三级亚洲精品| 久久久久久久综合日本| 91美女片黄在线观看| 蜜乳av一区二区| 《视频一区视频二区| 666欧美在线视频| 国产成人av在线影院| 亚洲综合男人的天堂| 久久久久久亚洲综合影院红桃| 99re热视频精品| 老司机精品视频在线| 中文字幕在线不卡一区二区三区| 欧美精品乱人伦久久久久久| 成人视屏免费看| 蜜臀av一区二区三区| 亚洲色图色小说| 精品福利在线导航| 欧美体内she精视频| 国产精品香蕉一区二区三区| 亚洲一二三区视频在线观看| 国产清纯在线一区二区www| 欧美视频一区二区三区| 国产高清精品网站| 日韩激情在线观看| 国产精品麻豆视频| 精品国产乱码久久久久久闺蜜| 欧美综合天天夜夜久久| 成人免费视频app| 国内精品写真在线观看| 日日摸夜夜添夜夜添精品视频| 成人欧美一区二区三区视频网页| 日韩欧美国产成人一区二区|