From 1a2b4b15eb57c7da2c3fc1a35d32379cff037fac Mon Sep 17 00:00:00 2001 From: moculus Date: Thu, 23 Aug 2007 14:51:05 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- code_examples/Reporting2.pm | 26 ++++++++++++-------------- mode/perl.py | 11 ++++++----- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/code_examples/Reporting2.pm b/code_examples/Reporting2.pm index fcce789..15da053 100644 --- a/code_examples/Reporting2.pm +++ b/code_examples/Reporting2.pm @@ -57,7 +57,7 @@ use DBI; =head1 NAME - TBB::Reporting +TBB::Reporting =head1 SYNOPSIS @@ -70,17 +70,16 @@ use DBI; =head1 DESCRIPTION - This class populates a data_by_user table, which aliases some - userdata IDs (in particular questions, formulas and conditions) to - names given to them by site-relations in the "user_data_alias" - table. +This class populates a data_by_user table, which aliases some userdata IDs (in +particular questions, formulas and conditions) to names given to them by +site-relations in the "user_data_alias" table. - After instantiating this method, run populate to create the table. +After instantiating this method, run populate to create the table. - What happens, in order, is this: +What happens, in order, is this: - 1. grab the user_data_alias data - 2. verify (via the RM) that each resource exists; if so add it to our aliases + 1. grab the user_data_alias data + 2. verify (via the RM) that each resource exists; if so add it to aliases 3. drop the old data_by_user table 4. create a new one using the aliases 5. get a list of all sessions @@ -90,12 +89,11 @@ use DBI; c. insert a row into data_by_user for this client 7. done - TODO: populate should dump out the old data_by_user first as a - backup, and maybe even automatically restore it if something fails - (but probably not). +TODO: populate should dump out the old data_by_user first as a backup, and +maybe even automatically restore it if something fails (but probably not). - TODO: less stuff should probably be hardcoded, even though our - setup here kind of sucks and is kind of temporary. +TODO: less stuff should probably be hardcoded, even though our setup here kind +of sucks and is kind of temporary. =cut diff --git a/mode/perl.py b/mode/perl.py index 2bd26c8..5425819 100644 --- a/mode/perl.py +++ b/mode/perl.py @@ -2,7 +2,7 @@ import re, sets, string, sys import color, commands, default, method, mode2, regex, tab2 from point2 import Point from lex3 import Grammar, PatternRule, ContextPatternRule, RegionRule, OverridePatternRule, PatternGroupRule -from method import Argument, Method +from method import Argument, Method, WrapParagraph class PodGrammar(Grammar): rules = [ @@ -307,7 +307,7 @@ class Perl(mode2.Fundamental): #self.add_action_and_bindings(PerlHashCleanup2(), ('C-c h',)) self.add_action_and_bindings(PerlViewModulePerldoc(), ('C-c v',)) self.add_action_and_bindings(PerlViewWordPerldoc(), ('C-c p',)) - self.add_action_and_bindings(PerlWrapLine(), ('M-q',)) + self.add_action_and_bindings(PerlWrapParagraph(), ('M-q',)) self.add_action_and_bindings(PerlGotoFunction(), ('C-c M-g',)) self.add_action_and_bindings(PerlWhichFunction(), ('C-c w',)) self.add_action_and_bindings(PerlListFunctions(), ('C-c W',)) @@ -527,7 +527,8 @@ class PerlHashCleanup(Method): w.kill(start_p, end_p) w.insert_string(start_p, data) -class PerlWrapLine(Method): +#class PerlWrapParagraph(WrapParagraph): +class PerlWrapParagraph: '''Wrap Comments and POD''' # enumerations for line types LT_COMMENT = 1 @@ -546,7 +547,7 @@ class PerlWrapLine(Method): ltype = None for t in h.tokens[y]: fqname = t.fqname() - if t.name == 'null' or t.name == 'eol': + if fqname == 'null' or fqname == 'eol': pass elif fqname.startswith('comment'): if ltype and ltype != 'comment': @@ -621,6 +622,6 @@ class PerlWrapLine(Method): if ltype == self.LT_COMMENT: self._fix_comments(c, w) elif ltype == self.LT_POD: - self._fix_pod(c, w) + WrapParagraph._execute(self, w, **vargs) else: w.set_error("did not detect comment or pod lines")