and finally the tools

This commit is contained in:
Stefan Kögl 2012-03-31 17:56:46 +02:00
parent ea5649a2eb
commit 512dcd24e4
5 changed files with 1058 additions and 0 deletions

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
import utils

View File

@ -0,0 +1,609 @@
/*
* jQuery UI screen structure and presentation
* This CSS file was generated by ThemeRoller, a Filament Group Project for jQuery UI
* Author: Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
* Visit ThemeRoller.com
*/
/*
* Note: If your ThemeRoller settings have a font size set in ems, your components will scale according to their parent element's font size.
* As a rule of thumb, set your body's font size to 62.5% to make 1em = 10px.
* body {font-size: 62.5%;}
*/
/*UI accordion*/
.ui-accordion {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
font-size: 1.1em;
}
.ui-accordion-group {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
border: 1px solid #cccccc;
border-bottom: none;
}
.ui-accordion-header {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
cursor: pointer;
background: #f6f6f6;
}
.ui-accordion-header a {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
display: block;
font-size: 1em;
font-weight: bold;
text-decoration: none;
padding: .5em .5em .5em 1.7em;
color: #1c94c4;
background: url(images/ef8c08_7x7_arrow_right.gif) .5em 50% no-repeat;
}
.ui-accordion-header a:hover {
background: url(images/ef8c08_7x7_arrow_right.gif) .5em 50% no-repeat;
color: #c77405;
}
.ui-accordion-header:hover {
background: #fdf5ce;
color: #c77405;
}
.selected .ui-accordion-header {background: #004;}
.selected .ui-accordion-header a, .selected .ui-accordion-header a:hover {
color: #eb8f00;
background: url(images/ef8c08_7x7_arrow_down.gif) .5em 50% no-repeat;
}
.ui-accordion-content {
/* background: #eeeeee url(images/eeeeee_40x100_textures_03_highlight_soft_100.png) 0 0 repeat-x; */
background: #eeeeee;
color: #333333;
font-size: 1em;
}
.ui-accordion-content p {
padding: 1em 1.7em 0.6em;
}
/*UI tabs*/
.ui-tabs-nav {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
font-size: 1.1em;
float: left;
position: relative;
z-index: 1;
border-right: 1px solid #cccccc;
bottom: -1px;
}
.ui-tabs-nav ul {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
}
.ui-tabs-nav li {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
float: left;
border: 1px solid #cccccc;
border-right: none;
}
.ui-tabs-nav li a {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
float: left;
font-size: 1em;
font-weight: bold;
text-decoration: none;
padding: .5em 1.7em;
color: #1c94c4;
background: #f6f6f6 url(images/f6f6f6_40x100_textures_02_glass_100.png) 0 50% repeat-x;
}
.ui-tabs-nav li a:hover {
background: #fdf5ce url(images/fdf5ce_40x100_textures_02_glass_100.png) 0 50% repeat-x;
color: #c77405;
}
.ui-tabs-nav li.ui-tabs-selected {
border-bottom-color: #ffffff;
}
.ui-tabs-nav li.ui-tabs-selected a, .ui-tabs-nav li.ui-tabs-selected a:hover {
background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
color: #eb8f00;
}
.ui-tabs-panel {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
clear:left;
border: 1px solid #cccccc;
background: #eeeeee url(images/eeeeee_40x100_textures_03_highlight_soft_100.png) 0 0 repeat-x;
color: #333333;
padding: 1.5em 1.7em;
font-size: 1.1em;
}
.ui-tabs-hide {
display: none;/* for accessible hiding: position: absolute; left: -99999999px*/;
}
/*slider*/
.ui-slider {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
font-size: 1.1em;
background: #eeeeee url(images/eeeeee_40x100_textures_03_highlight_soft_100.png) 0 0 repeat-x;
border: 1px solid #dddddd;
height: .8em;
position: relative;
}
.ui-slider-handle {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
position: absolute;
z-index: 2;
top: -3px;
width: 1.2em;
height: 1.2em;
background: #f6f6f6 url(images/f6f6f6_40x100_textures_02_glass_100.png) 0 50% repeat-x;
border: 1px solid #cccccc;
}
.ui-slider-handle:hover {
background: #fdf5ce url(images/fdf5ce_40x100_textures_02_glass_100.png) 0 50% repeat-x;
border: 1px solid #fbcb09;
}
.ui-slider-handle-active, .ui-slider-handle-active:hover {
background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
border: 1px solid #fbd850;
}
.ui-slider-range {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
height: .8em;
background: #fdf5ce url(images/fdf5ce_40x100_textures_02_glass_100.png) 0 50% repeat-x;
position: absolute;
border: 1px solid #cccccc;
border-left: 0;
border-right: 0;
top: -1px;
z-index: 1;
opacity:.7;
filter:Alpha(Opacity=70);
}
/*dialog*/
.ui-dialog {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
font-size: 1.1em;
background: #eeeeee url(images/eeeeee_40x100_textures_03_highlight_soft_100.png) 0 0 repeat-x;
color: #333333;
border: 4px solid #dddddd;
position: relative;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
z-index: 99999;
}
.ui-resizable .ui-resizable-handle {
display: block;
}
body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
.ui-resizable-n {
cursor: n-resize;
height: 7px;
width: 100%;
top: -5px;
left: 0px;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0px;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0px;
height: 100%;
}
.ui-resizable-w {
cursor: w-resize;
width: 7px;
left: -5px;
top: 0px;
height: 100%;
}
.ui-resizable-se {
cursor: se-resize;
width: 13px;
height: 13px;
right: 0px;
bottom: 0px;
background: url(images/222222_11x11_icon_resize_se.gif) no-repeat 0 0;
}
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: 0px;
bottom: 0px;
}
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 9px;
left: 0px;
top: 0px;
}
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: 0px;
top: 0px;
}
.ui-dialog-titlebar {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
padding: .5em 1.5em .5em 1em;
color: #1c94c4;
background: #f6f6f6 url(images/f6f6f6_40x100_textures_02_glass_100.png) 0 50% repeat-x;
border-bottom: 1px solid #cccccc;
font-size: 1em;
font-weight: bold;
position: relative;
}
.ui-dialog-title {}
.ui-dialog-titlebar-close {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
background: url(images/ef8c08_11x11_icon_close.gif) 0 0 no-repeat;
position: absolute;
right: 8px;
top: .7em;
width: 11px;
height: 11px;
z-index: 100;
}
.ui-dialog-titlebar-close-hover, .ui-dialog-titlebar-close:hover {
background: url(images/ef8c08_11x11_icon_close.gif) 0 0 no-repeat;
}
.ui-dialog-titlebar-close:active {
background: url(images/ef8c08_11x11_icon_close.gif) 0 0 no-repeat;
}
.ui-dialog-titlebar-close span {
display: none;
}
.ui-dialog-content {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
color: #333333;
padding: 1.5em 1.7em;
}
.ui-dialog-buttonpane {
position: absolute;
bottom: 0;
width: 100%;
text-align: left;
border-top: 1px solid #dddddd;
background: #eeeeee;
}
.ui-dialog-buttonpane button {
margin: .5em 0 .5em 8px;
color: #1c94c4;
background: #f6f6f6 url(images/f6f6f6_40x100_textures_02_glass_100.png) 0 50% repeat-x;
font-size: 1em;
border: 1px solid #cccccc;
cursor: pointer;
padding: .2em .6em .3em .6em;
line-height: 1.4em;
}
.ui-dialog-buttonpane button:hover {
color: #c77405;
background: #fdf5ce url(images/fdf5ce_40x100_textures_02_glass_100.png) 0 50% repeat-x;
border: 1px solid #fbcb09;
}
.ui-dialog-buttonpane button:active {
color: #eb8f00;
background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
border: 1px solid #fbd850;
}
/* This file skins dialog */
.ui-dialog.ui-draggable .ui-dialog-titlebar,
.ui-dialog.ui-draggable .ui-dialog-titlebar {
cursor: move;
}
/*datepicker*/
/* Main Style Sheet for jQuery UI date picker */
.ui-datepicker-div, .ui-datepicker-inline, #ui-datepicker-div {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
background: #eeeeee url(images/eeeeee_40x100_textures_03_highlight_soft_100.png) 0 0 repeat-x;
font-size: 1.1em;
border: 4px solid #dddddd;
width: 15.5em;
padding: 2.5em .5em .5em .5em;
position: relative;
}
.ui-datepicker-div, #ui-datepicker-div {
z-index: 9999; /*must have*/
display: none;
}
.ui-datepicker-inline {
float: left;
display: block;
}
.ui-datepicker-control {
display: none;
}
.ui-datepicker-current {
display: none;
}
.ui-datepicker-next, .ui-datepicker-prev {
position: absolute;
left: .5em;
top: .5em;
background: #f6f6f6 url(images/f6f6f6_40x100_textures_02_glass_100.png) 0 50% repeat-x;
}
.ui-datepicker-next {
left: 14.6em;
}
.ui-datepicker-next:hover, .ui-datepicker-prev:hover {
background: #fdf5ce url(images/fdf5ce_40x100_textures_02_glass_100.png) 0 50% repeat-x;
}
.ui-datepicker-next a, .ui-datepicker-prev a {
text-indent: -999999px;
width: 1.3em;
height: 1.4em;
display: block;
font-size: 1em;
background: url(images/ef8c08_7x7_arrow_left.gif) 50% 50% no-repeat;
border: 1px solid #cccccc;
cursor: pointer;
}
.ui-datepicker-next a {
background: url(images/ef8c08_7x7_arrow_right.gif) 50% 50% no-repeat;
}
.ui-datepicker-prev a:hover {
background: url(images/ef8c08_7x7_arrow_left.gif) 50% 50% no-repeat;
}
.ui-datepicker-next a:hover {
background: url(images/ef8c08_7x7_arrow_right.gif) 50% 50% no-repeat;
}
.ui-datepicker-prev a:active {
background: url(images/ef8c08_7x7_arrow_left.gif) 50% 50% no-repeat;
}
.ui-datepicker-next a:active {
background: url(images/ef8c08_7x7_arrow_right.gif) 50% 50% no-repeat;
}
.ui-datepicker-header select {
border: 1px solid #cccccc;
color: #1c94c4;
background: #f6f6f6;
font-size: 1em;
line-height: 1.4em;
position: absolute;
top: .5em;
margin: 0 !important;
}
.ui-datepicker-header option:focus, .ui-datepicker-header option:hover {
background: #fdf5ce;
}
.ui-datepicker-header select.ui-datepicker-new-month {
width: 7em;
left: 2.2em;
}
.ui-datepicker-header select.ui-datepicker-new-year {
width: 5em;
left: 9.4em;
}
table.ui-datepicker {
width: 15.5em;
text-align: right;
}
table.ui-datepicker td a {
padding: .1em .3em .1em 0;
display: block;
color: #1c94c4;
background: #f6f6f6 url(images/f6f6f6_40x100_textures_02_glass_100.png) 0 50% repeat-x;
cursor: pointer;
border: 1px solid #eeeeee;
}
table.ui-datepicker td a:hover {
border: 1px solid #fbcb09;
color: #c77405;
background: #fdf5ce url(images/fdf5ce_40x100_textures_02_glass_100.png) 0 50% repeat-x;
}
table.ui-datepicker td a:active {
border: 1px solid #fbd850;
color: #eb8f00;
background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
}
table.ui-datepicker .ui-datepicker-title-row td {
padding: .3em 0;
text-align: center;
font-size: .9em;
color: #333333;
text-transform: uppercase;
}
table.ui-datepicker .ui-datepicker-title-row td a {
color: #333333;
}
.ui-datepicker-cover {
display: none;
display/**/: block;
position: absolute;
z-index: -1;
filter: mask();
top: -4px;
left: -4px;
width: 193px;
height: 200px;
}
/*
Generic ThemeRoller Classes
>> Make your jQuery Components ThemeRoller-Compatible!
*/
/*component global class*/
.ui-component {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
font-size: 1.1em;
}
/*component content styles*/
.ui-component-content {
border: 1px solid #dddddd;
background: #eeeeee url(images/eeeeee_40x100_textures_03_highlight_soft_100.png) 0 0 repeat-x;
color: #333333;
}
.ui-component-content a {
color: #333333;
text-decoration: underline;
}
/*component states*/
.ui-default-state {
border: 1px solid #cccccc;
background: #f6f6f6 url(images/f6f6f6_40x100_textures_02_glass_100.png) 0 50% repeat-x;
font-weight: bold;
color: #1c94c4 !important;
}
.ui-default-state a {
color: #1c94c4;
}
.ui-default-state:hover, .ui-hover-state {
border: 1px solid #fbcb09;
background: #fdf5ce url(images/fdf5ce_40x100_textures_02_glass_100.png) 0 50% repeat-x;
font-weight: bold;
color: #c77405 !important;
}
.ui-hover-state a {
color: #c77405;
}
.ui-default-state:active, .ui-active-state {
border: 1px solid #fbd850;
background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
font-weight: bold;
color: #eb8f00 !important;
outline: none;
}
.ui-active-state a {
color: #eb8f00;
outline: none;
}
/*icons*/
.ui-arrow-right-default {background: url(images/ef8c08_7x7_arrow_right.gif) no-repeat 50% 50%;}
.ui-arrow-right-default:hover, .ui-arrow-right-hover {background: url(images/ef8c08_7x7_arrow_right.gif) no-repeat 50% 50%;}
.ui-arrow-right-default:active, .ui-arrow-right-active {background: url(images/ef8c08_7x7_arrow_right.gif) no-repeat 50% 50%;}
.ui-arrow-right-content {background: url(images/222222_7x7_arrow_right.gif) no-repeat 50% 50%;}
.ui-arrow-left-default {background: url(images/ef8c08_7x7_arrow_left.gif) no-repeat 50% 50%;}
.ui-arrow-left-default:hover, .ui-arrow-left-hover {background: url(images/ef8c08_7x7_arrow_left.gif) no-repeat 50% 50%;}
.ui-arrow-left-default:active, .ui-arrow-left-active {background: url(images/ef8c08_7x7_arrow_left.gif) no-repeat 50% 50%;}
.ui-arrow-left-content {background: url(images/222222_7x7_arrow_left.gif) no-repeat 50% 50%;}
.ui-arrow-down-default {background: url(images/ef8c08_7x7_arrow_down.gif) no-repeat 50% 50%;}
.ui-arrow-down-default:hover, .ui-arrow-down-hover {background: url(images/ef8c08_7x7_arrow_down.gif) no-repeat 50% 50%;}
.ui-arrow-down-default:active, .ui-arrow-down-active {background: url(images/ef8c08_7x7_arrow_down.gif) no-repeat 50% 50%;}
.ui-arrow-down-content {background: url(images/222222_7x7_arrow_down.gif) no-repeat 50% 50%;}
.ui-arrow-up-default {background: url(images/ef8c08_7x7_arrow_up.gif) no-repeat 50% 50%;}
.ui-arrow-up-default:hover, .ui-arrow-up-hover {background: url(images/ef8c08_7x7_arrow_up.gif) no-repeat 50% 50%;}
.ui-arrow-up-default:active, .ui-arrow-up-active {background: url(images/ef8c08_7x7_arrow_up.gif) no-repeat 50% 50%;}
.ui-arrow-up-content {background: url(images/222222_7x7_arrow_up.gif) no-repeat 50% 50%;}
.ui-close-default {background: url(images/ef8c08_11x11_icon_close.gif) no-repeat 50% 50%;}
.ui-close-default:hover, .ui-close-hover {background: url(images/ef8c08_11x11_icon_close.gif) no-repeat 50% 50%;}
.ui-close-default:active, .ui-close-active {background: url(images/ef8c08_11x11_icon_close.gif) no-repeat 50% 50%;}
.ui-close-content {background: url(images/ef8c08_11x11_icon_close.gif) no-repeat 50% 50%;}
.ui-folder-closed-default {background: url(images/ef8c08_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
.ui-folder-closed-default:hover, .ui-folder-closed-hover {background: url(images/ef8c08_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
.ui-folder-closed-default:active, .ui-folder-closed-active {background: url(images/ef8c08_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
.ui-folder-closed-content {background: url(images/ef8c08_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
.ui-folder-open-default {background: url(images/ef8c08_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
.ui-folder-open-default:hover, .ui-folder-open-hover {background: url(images/ef8c08_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
.ui-folder-open-default:active, .ui-folder-open-active {background: url(images/ef8c08_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
.ui-folder-open-content {background: url(images/ef8c08_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
.ui-doc-default {background: url(images/ef8c08_11x11_icon_doc.gif) no-repeat 50% 50%;}
.ui-doc-default:hover, .ui-doc-hover {background: url(images/ef8c08_11x11_icon_doc.gif) no-repeat 50% 50%;}
.ui-doc-default:active, .ui-doc-active {background: url(images/ef8c08_11x11_icon_doc.gif) no-repeat 50% 50%;}
.ui-doc-content {background: url(images/222222_11x11_icon_doc.gif) no-repeat 50% 50%;}
.ui-arrows-leftright-default {background: url(images/ef8c08_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
.ui-arrows-leftright-default:hover, .ui-arrows-leftright-hover {background: url(images/ef8c08_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
.ui-arrows-leftright-default:active, .ui-arrows-leftright-active {background: url(images/ef8c08_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
.ui-arrows-leftright-content {background: url(images/222222_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
.ui-arrows-updown-default {background: url(images/ef8c08_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
.ui-arrows-updown-default:hover, .ui-arrows-updown-hover {background: url(images/ef8c08_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
.ui-arrows-updown-default:active, .ui-arrows-updown-active {background: url(images/ef8c08_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
.ui-arrows-updown-content {background: url(images/222222_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
.ui-minus-default {background: url(images/ef8c08_11x11_icon_minus.gif) no-repeat 50% 50%;}
.ui-minus-default:hover, .ui-minus-hover {background: url(images/ef8c08_11x11_icon_minus.gif) no-repeat 50% 50%;}
.ui-minus-default:active, .ui-minus-active {background: url(images/ef8c08_11x11_icon_minus.gif) no-repeat 50% 50%;}
.ui-minus-content {background: url(images/222222_11x11_icon_minus.gif) no-repeat 50% 50%;}
.ui-plus-default {background: url(images/ef8c08_11x11_icon_plus.gif) no-repeat 50% 50%;}
.ui-plus-default:hover, .ui-plus-hover {background: url(images/ef8c08_11x11_icon_plus.gif) no-repeat 50% 50%;}
.ui-plus-default:active, .ui-plus-active {background: url(images/ef8c08_11x11_icon_plus.gif) no-repeat 50% 50%;}
.ui-plus-content {background: url(images/222222_11x11_icon_plus.gif) no-repeat 50% 50%;}
/*hidden elements*/
.ui-hidden {
display: none;/* for accessible hiding: position: absolute; left: -99999999px*/;
}
.ui-accessible-hidden {
position: absolute; left: -99999999px;
}
/*reset styles*/
.ui-reset {
/*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
}
/*clearfix class*/
.ui-clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.ui-clearfix {display: inline-block;}
/* Hides from IE-mac \*/
* html .ui-clearfix {height: 1%;}
.ui-clearfix {display: block;}
/* End hide from IE-mac */
/* Note: for resizable styles, use the styles listed above in the dialog section */

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,162 @@
# -*- coding: utf-8 -*-
"""This module globally bundles some utility functions for my ctdo plugins"""
from sys import maxint
from datetime import datetime, date, time
from trac.util.datefmt import utc, timezone
from re import match
from trac.wiki import WikiPage
from trac.web.chrome import ITemplateProvider
from trac.core import Component, implements, TracError
class CTDOTools(Component):
implements(ITemplateProvider)
# ITemplateProvider methods
def get_templates_dirs(self):
from pkg_resources import resource_filename
return [resource_filename(__name__, 'templates')]
def get_htdocs_dirs(self):
"""Return a list of directories with static resources (such as style
sheets, images, etc.)
Each item in the list must be a `(prefix, abspath)` tuple. The
`prefix` part defines the path in the URL that requests to these
resources are prefixed with.
The `abspath` is the absolute path to the directory containing the
resources on the local file system.
"""
from pkg_resources import resource_filename
return [('hw', resource_filename(__name__, 'htdocs'))]
class ValidationError(ValueError):
"""simple exception class"""
def __str__(self):
return "ValidationError: value out of bounds!"
def validate_id(value):
"""type and range check"""
if (0 > int(value) > maxint):
raise ValidationError("invalid argument")
def validate_email(addr):
"""validates email against rfc822"""
rfc822_specials = '()<>@,;:\\"[]'
# First we validate the name portion (name@domain)
mychar = 0
while mychar < len(addr):
if addr[mychar] == '"' and (
not mychar or addr[mychar - 1] == '.' or addr[mychar - 1] == '"'):
mychar = mychar + 1
while mychar < len(addr):
if addr[mychar] == '"':
break
if addr[mychar] == '\\' and addr[mychar + 1] == ' ':
mychar += 2
continue
if ord(addr[mychar]) < 32 or ord(addr[mychar]) >= 127:
return 0
mychar += 1
else:
return False
if addr[mychar] == '@':
break
if addr[mychar] != '.':
return False
mychar += 1
continue
if addr[mychar] == '@':
break
if ord(addr[mychar]) <= 32 or ord(addr[mychar]) >= 127:
return False
if addr[mychar] in rfc822_specials:
return False
mychar += 1
if not mychar or addr[mychar - 1] == '.':
return False
# Next we validate the domain portion (name@domain)
domain = mychar = mychar + 1
if domain >= len(addr):
return False
count = 0
while mychar < len(addr):
if addr[mychar] == '.':
if mychar == domain or addr[mychar - 1] == '.':
return False
count += 1
if ord(addr[mychar]) <= 32 or ord(addr[mychar]) >= 127:
return False
if addr[mychar] in rfc822_specials:
return False
mychar += 1
return count >= 1
def gen_wiki_page(env, authname, page_name, content, remote_addr):
"""programatically creates a wiki page"""
page = WikiPage(env)
page.name = page_name
page.version = 1
page.text = content
page.save(authname,
'initially created by TracRendezVous',
remote_addr)
def date_cmp(left, right):
"""compares two dates"""
if left.time_begin < right.time_begin:
return -1
elif left.time_begin > right.time_begin:
return 1
else:
return 0
def date_parse(arg):
"""converts a date string of form dd.mm.yyyy into a datetime.date obj"""
groups = match("^(\d{1,2}).(\d{1,2}).(\d{4})$", arg).groups()
return date(int(groups[2]), int(groups[1]), int(groups[0]))
def time_parse(arg):
"""converts a time string of form MM:HH into a datetime.time obj"""
matched = match("^(\d{1,2}):(\d{1,2})$", arg).groups()
return time(int(matched[0]), int(matched[1]))
def datetime_parse(arg, tzinfo=utc):
"""converts a datetime string of form dd.mm.yyyy MM:HH into a
datetime.datetime obj"""
# get real tzinfo for the date taking dst into account
arg = datetime.strptime(arg, "%d.%m.%Y %H:%M").replace(tzinfo=tzinfo)
return local_to_utc(arg, tzinfo)
def local_to_utc(arg, tzinfo=utc):
"""converts local datetime to utc datetime"""
real_tz = tzinfo.fromutc(arg).tzinfo
return datetime(arg.year, arg.month, arg.day, arg.hour, arg.minute,
arg.second, tzinfo=real_tz).astimezone(utc)
def get_tz(session_tzname):
"""returns the timezone name and the timezone of the actual trac session"""
if session_tzname == 'UTC':
selected_tz = utc
else:
try:
selected_tz = timezone(session_tzname)
except Exception:
selected_tz = utc
return session_tzname, selected_tz

22
CTDOTools/setup.py Normal file
View File

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
setup(
name='TracCTDOTools', version='0.1',
packages=['ctdotools',],
entry_points = """
[trac.plugins]
ctdotools = ctdotools
""",
package_data={'ctdotools': ['templates/*.html',
'htdocs/css/*.css',
'htdocs/scripts/*',
'htdocs/images/*']},
author = "Stefan Kögl",
author_email = "hotshelf@ctdo.de",
description = "common tools and utils for my ctdo hosted trac plugins",
license = "GPL",
keywords = "jquery, tools, utils",
url = "http://trac.ctdo.de/dev/"
)