diff options
author | strom <strom@vehikel.(none)> | 2010-05-02 19:04:36 (GMT) |
---|---|---|
committer | strom <strom@vehikel.(none)> | 2010-05-02 19:04:36 (GMT) |
commit | f84b965aa7b4a28786b3520671a5d0fd1881cd6d (patch) | |
tree | 79be950bc29ee8c2eb9ffb1bd0fac6723c486d89 /ep_formater_html.py | |
parent | 6416d002a0c99678bc38f1997a9bbc94acd7ead3 (diff) |
Added a sampler for iterated function systems.
Diffstat (limited to 'ep_formater_html.py')
-rw-r--r-- | ep_formater_html.py | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/ep_formater_html.py b/ep_formater_html.py index e987b51..c35ff38 100644 --- a/ep_formater_html.py +++ b/ep_formater_html.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +import ka_utils """Generate HTML describing the genome.""" @@ -25,8 +26,6 @@ import exon_color import exon_position import exon_direction -ICON_WIDTH = ICON_HEIGHT = 48 - class HtmlFormater(object): """Html formater inv: self._indent >= 0 @@ -94,7 +93,8 @@ class HtmlFormater(object): return u'id_' + unicode(self.id_count) def get_absolutename(self, extension, postfix=None): - """Returns absolute path appended by filename of the generated HTML page.""" + """Returns absolute path appended by filename + of the generated HTML page.""" return os.path.join(self.get_pathname(), self.get_filename(extension, postfix)) @@ -254,14 +254,15 @@ class HtmlFormater(object): pathname = self.get_absolutename('png', postfix=identification) filename = self.get_filename('png', postfix=identification) surface = exon_color.Color.make_icon(color.rgba, alpha, - ICON_WIDTH, ICON_HEIGHT) + ka_utils.ICON_WIDTH, ka_utils.ICON_HEIGHT) surface.write_to_png(pathname) self.produced_files_list.append(pathname) description = color.explain(alpha) self._begin_list_item(identification) self._append_escaped(text) - self._image_item(filename, ICON_WIDTH, ICON_HEIGHT, description) + self._image_item(filename, ka_utils.ICON_WIDTH, ka_utils.ICON_HEIGHT, + description) self._end_list_item() def alpha_item(self, alpha, text): @@ -275,14 +276,15 @@ class HtmlFormater(object): pathname = self.get_absolutename('png', postfix=identification) filename = self.get_filename('png', postfix=identification) surface = exon_color.Color.make_icon((1.0, 1.0, 1.0, alpha), True, - ICON_WIDTH, ICON_HEIGHT) + ka_utils.ICON_WIDTH, ka_utils.ICON_HEIGHT) surface.write_to_png(pathname) self.produced_files_list.append(pathname) description = '%d%% opaque' % (100*alpha) self._begin_list_item(self._get_id()) self._append_escaped(text) - self._image_item(filename, ICON_WIDTH, ICON_HEIGHT, description) + self._image_item(filename, ka_utils.ICON_WIDTH, ka_utils.ICON_HEIGHT, + description) self._end_list_item() def color_array(self, color_list, text, alpha=True): @@ -300,12 +302,13 @@ class HtmlFormater(object): pathname = self.get_absolutename('png', postfix=identification) filename = self.get_filename('png', postfix=identification) surface = color.make_icon(color.rgba, alpha, - ICON_WIDTH, ICON_HEIGHT) + ka_utils.ICON_WIDTH, ka_utils.ICON_HEIGHT) surface.write_to_png(pathname) self.produced_files_list.append(pathname) description = color.explain(alpha) - self._image_item(filename, ICON_WIDTH, ICON_HEIGHT, \ - description, newline=False) + self._image_item(filename, + ka_utils.ICON_WIDTH, ka_utils.ICON_HEIGHT, + description, newline=False) self._end_list_item() def position_item(self, position, text): @@ -335,10 +338,11 @@ class HtmlFormater(object): pathname = self.get_absolutename('png', postfix=identification) filename = self.get_filename('png', postfix=identification) surface = exon_position.Position.make_icon(position_list, - ICON_WIDTH, ICON_HEIGHT) + ka_utils.ICON_WIDTH, ka_utils.ICON_HEIGHT) surface.write_to_png(pathname) self.produced_files_list.append(pathname) - self._image_item(filename, ICON_WIDTH, ICON_HEIGHT, description) + self._image_item(filename, ka_utils.ICON_WIDTH, ka_utils.ICON_HEIGHT, + description) self._end_list_item() def direction_item(self, direction, text): @@ -368,10 +372,11 @@ class HtmlFormater(object): pathname = self.get_absolutename('png', postfix=identification) filename = self.get_filename('png', postfix=identification) surface = exon_direction.Direction.make_icon(direction_list, - ICON_WIDTH, ICON_HEIGHT) + ka_utils.ICON_WIDTH, ka_utils.ICON_HEIGHT) surface.write_to_png(pathname) self.produced_files_list.append(pathname) - self._image_item(filename, ICON_WIDTH, ICON_HEIGHT, description) + self._image_item(filename, ka_utils.ICON_WIDTH, ka_utils.ICON_HEIGHT, + description) self._end_list_item() def surface_item(self, surface, text, description): |