From d53637f46cf217fc760d7aac58b4596843a73803 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Wed, 29 Oct 2003 22:07:36 +0000 Subject: merge development/* and help/* --- (limited to 'development') diff --git a/development/create_html_docu b/development/create_html_docu new file mode 100755 index 0000000..9ee0310 --- a/dev/null +++ b/development/create_html_docu @@ -0,0 +1,20 @@ +#!/bin/sh + +# $1 appname +# $2 AppName +# $3 Icon +# $4 filename to output + +echo "$2" > $4 +echo "" >> $4 +echo "

$2

" >> $4 + +echo "

FIXME Description
" >> $4 +echo "

" >> $4 +echo "" >> $4 +mkdir $OPIEDIR/help/en/html/$1 + + + diff --git a/development/cvs_add_html_skeleton b/development/cvs_add_html_skeleton new file mode 100755 index 0000000..c8d6351 --- a/dev/null +++ b/development/cvs_add_html_skeleton @@ -0,0 +1,5 @@ +#!/bin/sh + +echo "Adding HTML files for $1 to CVS" + +cvs add help/en/html/$1 help/en/html/$1.html help/en/html/opie-$1-help-en.control \ No newline at end of file diff --git a/development/cvs_add_translation b/development/cvs_add_translation new file mode 100755 index 0000000..78268e2 --- a/dev/null +++ b/development/cvs_add_translation @@ -0,0 +1,16 @@ +#!/bin/sh + +foo="" + +for i in i18n/??; +do + foo="$foo $i/$1" + +done +for i in i18n/??_??; +do + foo="$foo $i/$1" + +done + +cvs add $foo diff --git a/development/documents/opie-todo.html b/development/documents/opie-todo.html new file mode 100644 index 0000000..839fe39 --- a/dev/null +++ b/development/documents/opie-todo.html @@ -0,0 +1,46 @@ + + + + + + + + + + +
TODO
+ + + +
In Progress
+ + + +
Finished
+ + + +
+ + diff --git a/development/documents/opie-todo.inc b/development/documents/opie-todo.inc new file mode 100644 index 0000000..69b4baa --- a/dev/null +++ b/development/documents/opie-todo.inc @@ -0,0 +1,262 @@ +parentID = $id; + } + function getParentID() + { + return $this->parentID; + } + function addChild(&$child) + { + $this->children[] = &$child; + } + function getHtml($target, $status) + { + $out = ''; + foreach ($this->children as $child) { + $out .= $child->getHtml($target, $status); + } + return $out; + } + +} + +class KCategory extends KFeatures +{ + + var $type = 'category'; + var $name = ''; + var $children = array(); + + function KCategory($name) + { + $this->name = $name; + } + function getHtml($target, $status) + { + $out = ''; + foreach ($this->children as $child) { + $temp = $child->getHtml( $target, $status); + # don't display empty categories + if ($child->type == "category" && strlen($temp)) + { + $out .= sprintf("\t
  • %s\t
  • \n", $temp); + } else { + $out .= $temp; + } + } + if (strlen($out)) { + return sprintf("

    %s

    \n\t\n\n",$this->name,$out); + } + return ''; + } +} + +class KFeature extends KFeatures +{ + + var $resp_name = array(); + var $resp_email = array(); + var $summary = ''; + var $status = ''; + var $target = ''; + var $type = 'feature'; + + function KFeature($status, $target) + { + $this->status = $status; + $this->target = $target; + } + function getStatus() + { + return $this->status; + } + function getTarget() + { + return $this->target; + } + function setResponsible($name = null, $email = null) + { + $this->resp_name[] = $name; + $this->resp_email[] = $email; + } + function getResponsible() + { + # Nobody responsible? + if (count($this->resp_name) == 0) return ''; + + $out = ''; + for ($i = 0; $i < count($this->resp_name); $i++) { + if ($i > 0) $out .= ', '; + if ($this->resp_name[$i]) { + $out .= $this->resp_name[$i]; + } + if ($this->resp_name[$i] && $this->resp_email[$i]) $out .= " "; + if ($this->resp_email[$i]) { + $out .= '<'.$this->resp_email[$i].'>'; + } + } + $out .= ''; + return $out; + } + function setSummary($summary) + { + $this->summary .= $summary.' '; + } + function getHtml($target, $status){ + if ($this->target == $target && $this->status == $status) { + return sprintf("\t\t
  • %s%s
  • \n",$this->summary,$this->getResponsible()); + } + return ''; + } + +} + +function startElement($parser, $name, $attrs) { + global $tags; + global $parentID; + + global $insummary; + global $pcdata; + global $curtag; + + switch ($name) { + case 'FEATURES': + $parentID = 0; + $obj = new KFeatures(); + $tags = array($obj); + + $insummary = false; + $pcdata = ''; + $curtag = ''; + break; + case 'CATEGORY': + $obj = new KCategory($attrs['NAME']); + $obj->setParentID($parentID); + $tags[] = $obj; + $currentID = count($tags) - 1; + $tags[$parentID]->addChild($tags[$currentID]); + $parentID = $currentID; + + break; + case 'FEATURE': + $obj = new KFeature($attrs['STATUS'], $attrs['TARGET']); + $obj->setParentID($parentID); + $tags[] = $obj; + $currentID = count($tags) - 1; + $tags[$parentID]->addChild($tags[$currentID]); + $parentID = $currentID; + break; + case 'RESPONSIBLE': + $n = count($tags) - 1; + $tags[$n]->setResponsible(@$attrs['NAME'], @$attrs['EMAIL']); + break; + case 'SUMMARY': + $insummary = true; + $pcdata = ''; + break; + default: + if (!$insummary) { + break; + } + $curtag = strtolower($name); + $att = ''; + foreach ($attrs as $k => $v) { + $att .= ' '.strtolower($k).'="'.$v.'"'; + } + + $pcdata .= '<'.$curtag.$att.'>'; + break; + } +} + +function endElement($parser, $name) { + global $parentID; + global $tags; + + global $curtag; + global $pcdata; + global $insummary; + + switch ($name) { + case "FEATURE": + $n = count($tags) - 1; + $parentID = $tags[$n]->getParentID(); + break; + case "CATEGORY": + $parentID = $tags[$parentID]->getParentID(); + break; + case "SUMMARY": + $n = count($tags) - 1; + $tags[$n]->setSummary($pcdata); + + $insummary = false; + $pcdata = ''; + break; + default: + if ($insummary) { + $pcdata .= ''; + } + break; + } +} + +function characterData($parser, $data) { + global $htmltag; + global $tags; + + global $pcdata; + global $curtag; + global $insummary; + + if (!$insummary) { + return; + } + $pcdata .= htmlspecialchars($data); +} + +function parse( $file ) { + + $xml_parser = xml_parser_create(); + + xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true); + xml_set_element_handler($xml_parser, "startElement", "endElement"); + xml_set_character_data_handler($xml_parser, "characterData"); + + if (!($fp = fopen($file, "r"))) { + die("could not open XML input"); + } + + + while ($data = fread($fp, 4096)) { + if (!xml_parse($xml_parser, $data, feof($fp))) { + die(sprintf("XML error: %s at line %d", + xml_error_string(xml_get_error_code($xml_parser)), + xml_get_current_line_number($xml_parser))); + } + } + + xml_parser_free($xml_parser); +} + + + +function printHtml($target, $status) +{ + global $tags; + if (!is_array($tags)) { + die('You must parse the xml file first with parse("filename.xml");'); + } + print($tags[0]->getHtml($target,$status)); +} + + +?> diff --git a/development/documents/opie-todo.xml b/development/documents/opie-todo.xml new file mode 100644 index 0000000..8766e92 --- a/dev/null +++ b/development/documents/opie-todo.xml @@ -0,0 +1,59 @@ + + + + + + + + + Fix this file + + + + add this file + + + + Datebook Recurrence Dialog not fully translated/translatable + + + + + + + + + + A hell lot of Documentation is missing. Check help/en/html + + + OSearch DOCU does refer to settings.html which should be osearch/settings.html + + + diff --git a/development/documents/opie.dtd b/development/documents/opie.dtd new file mode 100644 index 0000000..3ed436b --- a/dev/null +++ b/development/documents/opie.dtd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/development/mkHelpSkeleton b/development/mkHelpSkeleton new file mode 100755 index 0000000..d7914fe --- a/dev/null +++ b/development/mkHelpSkeleton @@ -0,0 +1,116 @@ +#!/usr/bin/env python +""" +This skript creates a help skeleton for a certain application +(C) Michael 'Mickey' Lauer who did this even if he had a lot of other stuff to do... THANKS +""" + +import os +import sys + +COUNTRYCODES = "da de en fr nl pl hu no pt it pt_BR ja sl zh_CN es ko zh_TW".split() +OPIEDIR = os.environ["OPIEDIR"] + +#Package: opie-appskey-help-en +#Files: help/en/html/opie-appskey.html +#Priority: optional +#Section: opie/onlinedoc +#Maintainer: ljp +#Architecture: arm +#Version: $QPE_VERSION-$SUB_VERSION +#Depends: opie-appskey +#License: GPL +#Description: Application Key help files (english) + +def doit( name, cc ): + """Create a help skeleton corresponding to a package described by a desktop file.""" + + desktop = {} + for line in file( name ): + try: + key, value = line.split( '=' ) + except ValueError: + pass + else: + desktop[key.strip()] = value.strip() + + try: + application = desktop["Exec"] + except: + fail( "No Exec given in .desktop file" ) + + print "Generating help skeleton for application '%s'..." % application + helpdirname = "%s/help/%s/html" % ( OPIEDIR, cc ) + helpappdirname = "%s/%s" % ( helpdirname, application ) + makecontrol( helpdirname, application, cc, desktop ) + makedir( helpappdirname ) + makehtml( helpdirname, application, cc, desktop ) + +#------------------------------------------------------# +def makehtml( directory, application, cc, desktop ): + """Creates the help template file.""" + + helpfilename = "%s/%s.html" % ( directory, application ) + print "Creating help file '%s'" % helpfilename + h = file( helpfilename, "w" ) + print >> h, """ %s + +

    %s

    +
    + + +""" % ( application, application ) + +#------------------------------------------------------# +def makecontrol( directory, application, cc, desktop ): + """Creates the .control file.""" + + controlfilename = "%s/opie-%s-help-%s.control" % ( directory, application, cc ) + print "Creating control file '%s'" % controlfilename + c = file( controlfilename, "w" ) + print >> c, "Package: opie-%s-help-%s" % ( application, cc ) + print >> c, "Files: help/%s/html/%s.html help/%s/html/%s" % ( cc, application, cc, application ) + print >> c, "Priority: optional" + print >> c, "Section: opie/onlinedoc" + print >> c, "Maintainer: %s" % desktop.get( "Maintainer", "Team Opie " ) + print >> c, "Version: $QPE_VERSION-$SUB_VERSION" + print >> c, "Depends: opie-%s" % application + print >> c, "License: GPL" + print >> c, "Description: %s help files (%s)" % ( application, cc ) + +#------------------------------------------------------# +def makedir( name ): + """Creates a directory.""" + + print "Creating directory '%s'" % name + if not os.path.exists( name ): os.mkdir( name ) + +#------------------------------------------------------# +def fail( reason ): + """Fails with a reason.""" + print reason + sys.exit( -1 ) + +#------------------------------------------------------# +def checkUsage( args ): + """Checks calling syntax.""" + + if len( args ) < 2: + fail( """ +Usage: %s .desktop [countrycode] + +If no countrycode is given, defaults to 'en' +If countrycode 'all' is given, generates skeletons +for all known countrycodes: %s""" % ( args[0], ", ".join( COUNTRYCODES ) ) ) + +#------------------------------------------------------# + +if __name__ == "__main__": + checkUsage( sys.argv ) + + if len ( sys.argv ) == 2: + doit( sys.argv[1], "en" ) + elif len( sys.argv ) == 3: + if sys.argv[2] == "all": + [ doit( sys.argv[1], x ) for x in split() ] + else: + doit( sys.argv[1], sys.argv[2] ) diff --git a/development/opie-1.mrproject b/development/opie-1.mrproject new file mode 100644 index 0000000..34836ac --- a/dev/null +++ b/development/opie-1.mrproject @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/development/sort_desktop_files.pl b/development/sort_desktop_files.pl new file mode 100755 index 0000000..e553b9e --- a/dev/null +++ b/development/sort_desktop_files.pl @@ -0,0 +1,76 @@ +#!/usr/bin/perl -w +# Copyright (c) 2002,2003 by +# Bruno Rodrigues +# under the GNU GPL license 2.0 or newer +# sort_desktop_files.pl,v 1.1.2.1 2003/07/01 02:22:56 davipt Exp +# ----------------------------------------------------- +# This script reads a .desktop file and sorts its values +# in the following format: +# [Desktop Entry] +# field1=val1 \ +# field2=val2 > Sorted by field name +# ... / +# Name=name +# Comment=comment +# Name[lang1]=... \ +# Comment[lang1]=... > Sorted by language name +# Name[lang2]=... / + +use strict; +use vars qw{$line %data %tr}; + +%data = (); %tr = (); + +# Read first line and make sure it's "[Desktop Entry]" +$line = <>; chop($line); +die "E: File does not start with [Desktop Entry] ($line)\n" unless $line =~ /^\[Desktop Entry\]$/; + +my $end=0; +while($line = <>) { + # Ignore fields without values + next if $line =~ /^\s*([^\s]+)\s*=\s*$/; + + # Ignore empty line in the end + if($line =~ /^\s*$/) { + if($end==0) { $end=1; next; + } else { die "E: Empty line in middle of file\n"; + } + } + + # Die if line is not "field = value" + die "E: Error in line - not field=value ($line)\n" unless $line =~ /^\s*([^\s]+)\s*=\s*(.+?)\s*$/; + + my ($key, $data) = ($1, $2); + + # Grab Name[lang] and Comment[lang] + if($key =~ /^(Name|Comment)\[(.+)\]$/i) { + $tr{$2}{$1} = $data; + } + # Grab Name and Comment + elsif($key =~ /^(Name|Comment)$/i) { + $tr{"0"}{$1} = $data; + } + # Die if there is other field[x] + elsif($key =~ /\[|\]/) { + die "E: Error in line - unknown field with [] ($line)\n"; + } + # Grab regular fields + else { + $data{$1} = $2; + } +} + + +print "[Desktop Entry]\n"; +foreach my $key (sort keys %data) { + print "$key=".$data{$key}."\n"; +} +foreach my $key (sort keys %tr) { + my %tr2 = %{$tr{$key}}; + foreach my $k2 (reverse sort keys %tr2) { + print $k2; + print "[$key]" unless $key eq "0"; + print "=". $tr2{$k2}. "\n"; + } +} + -- cgit v0.9.0.2