SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Trac 插件开发简介
  Trac 的增进方法

      金山软件 廖杰
 richard.liao.i@gmail.com


                            1
目录

a.Trac 增进
b.Trac 插件开发
c.Trac 定制系统




                   2
Trac 增进




          3
Trac 简介

• Trac 是什么
 – 最轻量级别的基于 Web 的软件项目管理环境
 – 背景 : Trac 0.12 dev, 支持 i18n
• 干净的 Trac 能做什么
 – ticket
 – wiki
 – 版本系统
 – 邮件提醒


                                 4
为什么要对 Trac 进行增进

•   用户环境需求
•   特殊功能
•   系统间互动
•   修正缺陷
•   应用集成




                        5
Trac 增进的方法

•   修改配置 , 调整 Trac 参数
•   安装第三方插件 , 扩展 Trac 功能
•   自己开发插件
•   对 Trac 打补丁




                           6
调整 Trac 的参数

• 基本配置 :
 – 通过 Admin 界面
 – 通过 trac-admin 命令行
• 特殊配置
 – 修改 trac.ini
 – 定制模板文件



                         7
安装第三方插件
• 插件大本营
 – http://trac-hacks.org
 – 超过 500 个项目
 – 分类
    •   插件
    •   宏
    •   主题
    •   脚本
    •   补丁
    •   应用集成


                           8
自己开发插件

• 扩展 Trac 某方面的功能
 – 插件
 –宏
 – 主题
 – 脚本




                   9
对 Trac 打补丁

• Trac 内置功能与需求冲突
• Trac 本身缺陷
• Trac 暂时不实现的功能




                     10
Trac 插件开发




            11
Trac 插件开发环境

•   可运行的 Trac 环境
•   Python
•   Subversion
•   easy_install
•   virtualenv( 可选 )




                         12
快速插件模板
• http://trac-hacks.org/wiki/TracQuickPluginTemplateScript
• 使用 paste.script 模板
• 可即刻部署




                                                             13
插件部署

• pyton egg 部署
  – setuptools 0.6c9
  – python setup.py bdist_egg
  – cp dist/*.egg ../test/plugins
• 部署方式
  – 全局
  – 本地
                                    14
Trac 插件系统

• Since Trac 0.9
• Python 语言
• 基于 Trac 组件结构




                      15
Trac 组件结构

• Trac core 实现了必须的组件核心
• Trac 的内置的模块都是组件
 – wiki
 – ticket
 – 版本系统
• 插件与内置模块是同一级别
 – 可使用插件替换内置模块
 – 可拆卸


                         16
Trac 组件结构
• ExtensionPoint
  – 对外接口
  – 其他组件可以扩展此接口 : plugin




                           17
Trac 组件结构

• 组件
  – 提供特定功能的对象
• 组件是 singleton
  – 用于提供功能
  – 不作为实体使用




                       18
Trac 组件结构

• 每个组件都有内置如下变量
 – env: 代表 trac 环境实例
 – config: trac 配置
 – log: trac 日志




                       19
Trac 组件结构
• trac.core




                          20
演示 : HelloWorld




                  21
调试

• tracd
  – tracd -r --port 8000 test
• log
  – self.env.log.debug
• 集成 Eclipse+PyDev 调试




                                22
Trac 插件开发相关

• 模板系统 : genshi
• 前端 : jquery
• SQL 数据库 : Trac Data Models




                               23
Trac 定制系统




            24
Trac 定制系统

•   基础配置
•   定制字段
•   定制工作流
•   复杂报表
•   选择主题
•   选择已有插件
•   开发定制插件

                     25
参考

• http://trac.edgewall.org/wiki/TracDev
• http://trac-hacks.org/
• http://trac-hacks.org/wiki/richard




                                          26

Contenu connexe

Similaire à 100305 trac-plugin-dev-intro

Python 于 webgame 的应用
Python 于 webgame 的应用Python 于 webgame 的应用
Python 于 webgame 的应用勇浩 赖
 
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰Scourgen Hong
 
Btrace intro(撒迦)
Btrace intro(撒迦)Btrace intro(撒迦)
Btrace intro(撒迦)ykdsg
 
Linux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeLinux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeAngel Boy
 
高级服务器设计和实现3
高级服务器设计和实现3高级服务器设计和实现3
高级服务器设计和实现3Feng Yu
 
DEV305 - ASP.NET 5 開發攻略
DEV305 - ASP.NET 5 開發攻略DEV305 - ASP.NET 5 開發攻略
DEV305 - ASP.NET 5 開發攻略Will Huang
 
基于Symfony框架下的快速企业级应用开发
基于Symfony框架下的快速企业级应用开发基于Symfony框架下的快速企业级应用开发
基于Symfony框架下的快速企业级应用开发mysqlops
 
Asp.net core v1.0
Asp.net core v1.0Asp.net core v1.0
Asp.net core v1.0國昭 張
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer TalkLarry Cai
 
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例Will Huang
 
Modern web 2020 - 使用 Nx 管理超大型前後端專案
Modern web 2020 - 使用 Nx 管理超大型前後端專案Modern web 2020 - 使用 Nx 管理超大型前後端專案
Modern web 2020 - 使用 Nx 管理超大型前後端專案升煌 黃
 
Nodejs & NAE
Nodejs & NAENodejs & NAE
Nodejs & NAEq3boy
 
如何选择 Docker 监控方案
如何选择 Docker 监控方案如何选择 Docker 监控方案
如何选择 Docker 监控方案Leo Zhou
 
ElasticSearch Training#2 (advanced concepts)-ESCC#1
ElasticSearch Training#2 (advanced concepts)-ESCC#1ElasticSearch Training#2 (advanced concepts)-ESCC#1
ElasticSearch Training#2 (advanced concepts)-ESCC#1medcl
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJSTechParty@UIC
 
基于MySQL开放复制协议的同步扩展
基于MySQL开放复制协议的同步扩展基于MySQL开放复制协议的同步扩展
基于MySQL开放复制协议的同步扩展Sky Jian
 

Similaire à 100305 trac-plugin-dev-intro (20)

Python 于 webgame 的应用
Python 于 webgame 的应用Python 于 webgame 的应用
Python 于 webgame 的应用
 
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
 
Btrace intro(撒迦)
Btrace intro(撒迦)Btrace intro(撒迦)
Btrace intro(撒迦)
 
Linux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeLinux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledge
 
高级服务器设计和实现3
高级服务器设计和实现3高级服务器设计和实现3
高级服务器设计和实现3
 
Ali-tomcat
Ali-tomcatAli-tomcat
Ali-tomcat
 
DEV305 - ASP.NET 5 開發攻略
DEV305 - ASP.NET 5 開發攻略DEV305 - ASP.NET 5 開發攻略
DEV305 - ASP.NET 5 開發攻略
 
基于Symfony框架下的快速企业级应用开发
基于Symfony框架下的快速企业级应用开发基于Symfony框架下的快速企业级应用开发
基于Symfony框架下的快速企业级应用开发
 
Asp.net core v1.0
Asp.net core v1.0Asp.net core v1.0
Asp.net core v1.0
 
Asp.net core v1.0
Asp.net core v1.0Asp.net core v1.0
Asp.net core v1.0
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer Talk
 
Win dbg入门
Win dbg入门Win dbg入门
Win dbg入门
 
Windbg入门
Windbg入门Windbg入门
Windbg入门
 
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
使用 TypeScript 駕馭 Web 世界的脫韁野馬:以 Angular 2 開發框架為例
 
Modern web 2020 - 使用 Nx 管理超大型前後端專案
Modern web 2020 - 使用 Nx 管理超大型前後端專案Modern web 2020 - 使用 Nx 管理超大型前後端專案
Modern web 2020 - 使用 Nx 管理超大型前後端專案
 
Nodejs & NAE
Nodejs & NAENodejs & NAE
Nodejs & NAE
 
如何选择 Docker 监控方案
如何选择 Docker 监控方案如何选择 Docker 监控方案
如何选择 Docker 监控方案
 
ElasticSearch Training#2 (advanced concepts)-ESCC#1
ElasticSearch Training#2 (advanced concepts)-ESCC#1ElasticSearch Training#2 (advanced concepts)-ESCC#1
ElasticSearch Training#2 (advanced concepts)-ESCC#1
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
基于MySQL开放复制协议的同步扩展
基于MySQL开放复制协议的同步扩展基于MySQL开放复制协议的同步扩展
基于MySQL开放复制协议的同步扩展
 

Plus de Zoom Quiet

产品信息收集系统Infoc的演变
产品信息收集系统Infoc的演变产品信息收集系统Infoc的演变
产品信息收集系统Infoc的演变Zoom Quiet
 
01s0401 go,互联网时代的c语言 许式伟
01s0401 go,互联网时代的c语言   许式伟01s0401 go,互联网时代的c语言   许式伟
01s0401 go,互联网时代的c语言 许式伟Zoom Quiet
 
Zoz pwned-by-the-owner-表惹程序猿
Zoz pwned-by-the-owner-表惹程序猿Zoz pwned-by-the-owner-表惹程序猿
Zoz pwned-by-the-owner-表惹程序猿Zoom Quiet
 
金山云查询系统改进之路1
金山云查询系统改进之路1金山云查询系统改进之路1
金山云查询系统改进之路1Zoom Quiet
 
Zh120226techparty zd-story
Zh120226techparty zd-storyZh120226techparty zd-story
Zh120226techparty zd-storyZoom Quiet
 
Zh120226techparty velocity2011-review
Zh120226techparty velocity2011-reviewZh120226techparty velocity2011-review
Zh120226techparty velocity2011-reviewZoom Quiet
 
Zh120226techparty jeff kit-ios-toolbox
Zh120226techparty jeff kit-ios-toolboxZh120226techparty jeff kit-ios-toolbox
Zh120226techparty jeff kit-ios-toolboxZoom Quiet
 
Velocity2011分享
Velocity2011分享Velocity2011分享
Velocity2011分享Zoom Quiet
 
陈正 Introduction to-sae_python
陈正   Introduction to-sae_python陈正   Introduction to-sae_python
陈正 Introduction to-sae_pythonZoom Quiet
 
111218 zhtechparty-panda讲稿
111218 zhtechparty-panda讲稿111218 zhtechparty-panda讲稿
111218 zhtechparty-panda讲稿Zoom Quiet
 
111218 zhtechparty-移动互联网产品需求分析
111218 zhtechparty-移动互联网产品需求分析111218 zhtechparty-移动互联网产品需求分析
111218 zhtechparty-移动互联网产品需求分析Zoom Quiet
 
111218 zhtechparty-zd-浅谈symbian开发
111218 zhtechparty-zd-浅谈symbian开发111218 zhtechparty-zd-浅谈symbian开发
111218 zhtechparty-zd-浅谈symbian开发Zoom Quiet
 
ImpoImport this, that, and the other thing: custom importersrt not for_y
ImpoImport this, that, and the other thing: custom importersrt not for_yImpoImport this, that, and the other thing: custom importersrt not for_y
ImpoImport this, that, and the other thing: custom importersrt not for_yZoom Quiet
 
Import this, that, and the other thing: custom importers
Import this, that, and the other thing: custom importersImport this, that, and the other thing: custom importers
Import this, that, and the other thing: custom importersZoom Quiet
 
金山卫士界面框架
金山卫士界面框架金山卫士界面框架
金山卫士界面框架Zoom Quiet
 
111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysql111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysqlZoom Quiet
 

Plus de Zoom Quiet (20)

42qu thrift1
42qu thrift142qu thrift1
42qu thrift1
 
产品信息收集系统Infoc的演变
产品信息收集系统Infoc的演变产品信息收集系统Infoc的演变
产品信息收集系统Infoc的演变
 
Go courseday3
Go courseday3Go courseday3
Go courseday3
 
Go courseday2
Go courseday2Go courseday2
Go courseday2
 
Go courseday1
Go courseday1Go courseday1
Go courseday1
 
01s0401 go,互联网时代的c语言 许式伟
01s0401 go,互联网时代的c语言   许式伟01s0401 go,互联网时代的c语言   许式伟
01s0401 go,互联网时代的c语言 许式伟
 
Zoz pwned-by-the-owner-表惹程序猿
Zoz pwned-by-the-owner-表惹程序猿Zoz pwned-by-the-owner-表惹程序猿
Zoz pwned-by-the-owner-表惹程序猿
 
金山云查询系统改进之路1
金山云查询系统改进之路1金山云查询系统改进之路1
金山云查询系统改进之路1
 
Zh120226techparty zd-story
Zh120226techparty zd-storyZh120226techparty zd-story
Zh120226techparty zd-story
 
Zh120226techparty velocity2011-review
Zh120226techparty velocity2011-reviewZh120226techparty velocity2011-review
Zh120226techparty velocity2011-review
 
Zh120226techparty jeff kit-ios-toolbox
Zh120226techparty jeff kit-ios-toolboxZh120226techparty jeff kit-ios-toolbox
Zh120226techparty jeff kit-ios-toolbox
 
Velocity2011分享
Velocity2011分享Velocity2011分享
Velocity2011分享
 
陈正 Introduction to-sae_python
陈正   Introduction to-sae_python陈正   Introduction to-sae_python
陈正 Introduction to-sae_python
 
111218 zhtechparty-panda讲稿
111218 zhtechparty-panda讲稿111218 zhtechparty-panda讲稿
111218 zhtechparty-panda讲稿
 
111218 zhtechparty-移动互联网产品需求分析
111218 zhtechparty-移动互联网产品需求分析111218 zhtechparty-移动互联网产品需求分析
111218 zhtechparty-移动互联网产品需求分析
 
111218 zhtechparty-zd-浅谈symbian开发
111218 zhtechparty-zd-浅谈symbian开发111218 zhtechparty-zd-浅谈symbian开发
111218 zhtechparty-zd-浅谈symbian开发
 
ImpoImport this, that, and the other thing: custom importersrt not for_y
ImpoImport this, that, and the other thing: custom importersrt not for_yImpoImport this, that, and the other thing: custom importersrt not for_y
ImpoImport this, that, and the other thing: custom importersrt not for_y
 
Import this, that, and the other thing: custom importers
Import this, that, and the other thing: custom importersImport this, that, and the other thing: custom importers
Import this, that, and the other thing: custom importers
 
金山卫士界面框架
金山卫士界面框架金山卫士界面框架
金山卫士界面框架
 
111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysql111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysql
 

100305 trac-plugin-dev-intro