Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
83ca7d66
D
Dak
项目概览
喜羊羊3508
/
Dak
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Dak
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
83ca7d66
编写于
9月 18, 2010
作者:
M
Mark Hymers
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move prodding and note editing into queue.py
Signed-off-by:
N
Mark Hymers
<
mhy@debian.org
>
上级
d34b076f
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
90 addition
and
88 deletion
+90
-88
dak/process_new.py
dak/process_new.py
+0
-88
daklib/queue.py
daklib/queue.py
+90
-0
未找到文件。
dak/process_new.py
浏览文件 @
83ca7d66
...
...
@@ -333,43 +333,6 @@ def edit_overrides (new, upload, session):
return
new
################################################################################
def
edit_note
(
note
,
upload
,
session
):
# Write the current data to a temporary file
(
fd
,
temp_filename
)
=
utils
.
temp_filename
()
editor
=
os
.
environ
.
get
(
"EDITOR"
,
"vi"
)
answer
=
'E'
while
answer
==
'E'
:
os
.
system
(
"%s %s"
%
(
editor
,
temp_filename
))
temp_file
=
utils
.
open_file
(
temp_filename
)
newnote
=
temp_file
.
read
().
rstrip
()
temp_file
.
close
()
print
"New Note:"
print
utils
.
prefix_multi_line_string
(
newnote
,
" "
)
prompt
=
"[D]one, Edit, Abandon, Quit ?"
answer
=
"XXX"
while
prompt
.
find
(
answer
)
==
-
1
:
answer
=
utils
.
our_raw_input
(
prompt
)
m
=
re_default_answer
.
search
(
prompt
)
if
answer
==
""
:
answer
=
m
.
group
(
1
)
answer
=
answer
[:
1
].
upper
()
os
.
unlink
(
temp_filename
)
if
answer
==
'A'
:
return
elif
answer
==
'Q'
:
end
()
sys
.
exit
(
0
)
comment
=
NewComment
()
comment
.
package
=
upload
.
pkg
.
changes
[
"source"
]
comment
.
version
=
upload
.
pkg
.
changes
[
"version"
]
comment
.
comment
=
newnote
comment
.
author
=
utils
.
whoami
()
comment
.
trainee
=
bool
(
Options
[
"Trainee"
])
session
.
add
(
comment
)
session
.
commit
()
################################################################################
...
...
@@ -448,57 +411,6 @@ def add_overrides (new, upload, session):
################################################################################
def
prod_maintainer
(
notes
,
upload
):
cnf
=
Config
()
# Here we prepare an editor and get them ready to prod...
(
fd
,
temp_filename
)
=
utils
.
temp_filename
()
temp_file
=
os
.
fdopen
(
fd
,
'w'
)
for
note
in
notes
:
temp_file
.
write
(
note
.
comment
)
temp_file
.
close
()
editor
=
os
.
environ
.
get
(
"EDITOR"
,
"vi"
)
answer
=
'E'
while
answer
==
'E'
:
os
.
system
(
"%s %s"
%
(
editor
,
temp_filename
))
temp_fh
=
utils
.
open_file
(
temp_filename
)
prod_message
=
""
.
join
(
temp_fh
.
readlines
())
temp_fh
.
close
()
print
"Prod message:"
print
utils
.
prefix_multi_line_string
(
prod_message
,
" "
,
include_blank_lines
=
1
)
prompt
=
"[P]rod, Edit, Abandon, Quit ?"
answer
=
"XXX"
while
prompt
.
find
(
answer
)
==
-
1
:
answer
=
utils
.
our_raw_input
(
prompt
)
m
=
re_default_answer
.
search
(
prompt
)
if
answer
==
""
:
answer
=
m
.
group
(
1
)
answer
=
answer
[:
1
].
upper
()
os
.
unlink
(
temp_filename
)
if
answer
==
'A'
:
return
elif
answer
==
'Q'
:
end
()
sys
.
exit
(
0
)
# Otherwise, do the proding...
user_email_address
=
utils
.
whoami
()
+
" <%s>"
%
(
cnf
[
"Dinstall::MyAdminAddress"
])
Subst
=
upload
.
Subst
Subst
[
"__FROM_ADDRESS__"
]
=
user_email_address
Subst
[
"__PROD_MESSAGE__"
]
=
prod_message
Subst
[
"__CC__"
]
=
"Cc: "
+
cnf
[
"Dinstall::MyEmailAddress"
]
prod_mail_message
=
utils
.
TemplateSubst
(
Subst
,
cnf
[
"Dir::Templates"
]
+
"/process-new.prod"
)
# Send the prod mail
utils
.
send_mail
(
prod_mail_message
)
print
"Sent proding message"
################################################################################
def
do_new
(
upload
,
session
):
print
"NEW
\n
"
files
=
upload
.
pkg
.
files
...
...
daklib/queue.py
浏览文件 @
83ca7d66
...
...
@@ -247,6 +247,96 @@ class TarTime(object):
###############################################################################
def
prod_maintainer
(
notes
,
upload
):
cnf
=
Config
()
# Here we prepare an editor and get them ready to prod...
(
fd
,
temp_filename
)
=
utils
.
temp_filename
()
temp_file
=
os
.
fdopen
(
fd
,
'w'
)
for
note
in
notes
:
temp_file
.
write
(
note
.
comment
)
temp_file
.
close
()
editor
=
os
.
environ
.
get
(
"EDITOR"
,
"vi"
)
answer
=
'E'
while
answer
==
'E'
:
os
.
system
(
"%s %s"
%
(
editor
,
temp_filename
))
temp_fh
=
utils
.
open_file
(
temp_filename
)
prod_message
=
""
.
join
(
temp_fh
.
readlines
())
temp_fh
.
close
()
print
"Prod message:"
print
utils
.
prefix_multi_line_string
(
prod_message
,
" "
,
include_blank_lines
=
1
)
prompt
=
"[P]rod, Edit, Abandon, Quit ?"
answer
=
"XXX"
while
prompt
.
find
(
answer
)
==
-
1
:
answer
=
utils
.
our_raw_input
(
prompt
)
m
=
re_default_answer
.
search
(
prompt
)
if
answer
==
""
:
answer
=
m
.
group
(
1
)
answer
=
answer
[:
1
].
upper
()
os
.
unlink
(
temp_filename
)
if
answer
==
'A'
:
return
elif
answer
==
'Q'
:
end
()
sys
.
exit
(
0
)
# Otherwise, do the proding...
user_email_address
=
utils
.
whoami
()
+
" <%s>"
%
(
cnf
[
"Dinstall::MyAdminAddress"
])
Subst
=
upload
.
Subst
Subst
[
"__FROM_ADDRESS__"
]
=
user_email_address
Subst
[
"__PROD_MESSAGE__"
]
=
prod_message
Subst
[
"__CC__"
]
=
"Cc: "
+
cnf
[
"Dinstall::MyEmailAddress"
]
prod_mail_message
=
utils
.
TemplateSubst
(
Subst
,
cnf
[
"Dir::Templates"
]
+
"/process-new.prod"
)
# Send the prod mail
utils
.
send_mail
(
prod_mail_message
)
print
"Sent prodding message"
################################################################################
def
edit_note
(
note
,
upload
,
session
):
# Write the current data to a temporary file
(
fd
,
temp_filename
)
=
utils
.
temp_filename
()
editor
=
os
.
environ
.
get
(
"EDITOR"
,
"vi"
)
answer
=
'E'
while
answer
==
'E'
:
os
.
system
(
"%s %s"
%
(
editor
,
temp_filename
))
temp_file
=
utils
.
open_file
(
temp_filename
)
newnote
=
temp_file
.
read
().
rstrip
()
temp_file
.
close
()
print
"New Note:"
print
utils
.
prefix_multi_line_string
(
newnote
,
" "
)
prompt
=
"[D]one, Edit, Abandon, Quit ?"
answer
=
"XXX"
while
prompt
.
find
(
answer
)
==
-
1
:
answer
=
utils
.
our_raw_input
(
prompt
)
m
=
re_default_answer
.
search
(
prompt
)
if
answer
==
""
:
answer
=
m
.
group
(
1
)
answer
=
answer
[:
1
].
upper
()
os
.
unlink
(
temp_filename
)
if
answer
==
'A'
:
return
elif
answer
==
'Q'
:
end
()
sys
.
exit
(
0
)
comment
=
NewComment
()
comment
.
package
=
upload
.
pkg
.
changes
[
"source"
]
comment
.
version
=
upload
.
pkg
.
changes
[
"version"
]
comment
.
comment
=
newnote
comment
.
author
=
utils
.
whoami
()
comment
.
trainee
=
bool
(
Options
[
"Trainee"
])
session
.
add
(
comment
)
session
.
commit
()
###############################################################################
class
Upload
(
object
):
"""
Everything that has to do with an upload processed.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录