branch : pmacs2
This commit is contained in:
moculus 2007-08-23 14:51:05 +00:00
parent e536800327
commit 1a2b4b15eb
2 changed files with 18 additions and 19 deletions

View File

@ -57,7 +57,7 @@ use DBI;
=head1 NAME =head1 NAME
TBB::Reporting TBB::Reporting
=head1 SYNOPSIS =head1 SYNOPSIS
@ -70,17 +70,16 @@ use DBI;
=head1 DESCRIPTION =head1 DESCRIPTION
This class populates a data_by_user table, which aliases some This class populates a data_by_user table, which aliases some userdata IDs (in
userdata IDs (in particular questions, formulas and conditions) to particular questions, formulas and conditions) to names given to them by
names given to them by site-relations in the "user_data_alias" site-relations in the "user_data_alias" table.
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 1. grab the user_data_alias data
2. verify (via the RM) that each resource exists; if so add it to our aliases 2. verify (via the RM) that each resource exists; if so add it to aliases
3. drop the old data_by_user table 3. drop the old data_by_user table
4. create a new one using the aliases 4. create a new one using the aliases
5. get a list of all sessions 5. get a list of all sessions
@ -90,12 +89,11 @@ use DBI;
c. insert a row into data_by_user for this client c. insert a row into data_by_user for this client
7. done 7. done
TODO: populate should dump out the old data_by_user first as a TODO: populate should dump out the old data_by_user first as a backup, and
backup, and maybe even automatically restore it if something fails maybe even automatically restore it if something fails (but probably not).
(but probably not).
TODO: less stuff should probably be hardcoded, even though our TODO: less stuff should probably be hardcoded, even though our setup here kind
setup here kind of sucks and is kind of temporary. of sucks and is kind of temporary.
=cut =cut

View File

@ -2,7 +2,7 @@ import re, sets, string, sys
import color, commands, default, method, mode2, regex, tab2 import color, commands, default, method, mode2, regex, tab2
from point2 import Point from point2 import Point
from lex3 import Grammar, PatternRule, ContextPatternRule, RegionRule, OverridePatternRule, PatternGroupRule from lex3 import Grammar, PatternRule, ContextPatternRule, RegionRule, OverridePatternRule, PatternGroupRule
from method import Argument, Method from method import Argument, Method, WrapParagraph
class PodGrammar(Grammar): class PodGrammar(Grammar):
rules = [ rules = [
@ -307,7 +307,7 @@ class Perl(mode2.Fundamental):
#self.add_action_and_bindings(PerlHashCleanup2(), ('C-c h',)) #self.add_action_and_bindings(PerlHashCleanup2(), ('C-c h',))
self.add_action_and_bindings(PerlViewModulePerldoc(), ('C-c v',)) self.add_action_and_bindings(PerlViewModulePerldoc(), ('C-c v',))
self.add_action_and_bindings(PerlViewWordPerldoc(), ('C-c p',)) 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(PerlGotoFunction(), ('C-c M-g',))
self.add_action_and_bindings(PerlWhichFunction(), ('C-c w',)) self.add_action_and_bindings(PerlWhichFunction(), ('C-c w',))
self.add_action_and_bindings(PerlListFunctions(), ('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.kill(start_p, end_p)
w.insert_string(start_p, data) w.insert_string(start_p, data)
class PerlWrapLine(Method): #class PerlWrapParagraph(WrapParagraph):
class PerlWrapParagraph:
'''Wrap Comments and POD''' '''Wrap Comments and POD'''
# enumerations for line types # enumerations for line types
LT_COMMENT = 1 LT_COMMENT = 1
@ -546,7 +547,7 @@ class PerlWrapLine(Method):
ltype = None ltype = None
for t in h.tokens[y]: for t in h.tokens[y]:
fqname = t.fqname() fqname = t.fqname()
if t.name == 'null' or t.name == 'eol': if fqname == 'null' or fqname == 'eol':
pass pass
elif fqname.startswith('comment'): elif fqname.startswith('comment'):
if ltype and ltype != 'comment': if ltype and ltype != 'comment':
@ -621,6 +622,6 @@ class PerlWrapLine(Method):
if ltype == self.LT_COMMENT: if ltype == self.LT_COMMENT:
self._fix_comments(c, w) self._fix_comments(c, w)
elif ltype == self.LT_POD: elif ltype == self.LT_POD:
self._fix_pod(c, w) WrapParagraph._execute(self, w, **vargs)
else: else:
w.set_error("did not detect comment or pod lines") w.set_error("did not detect comment or pod lines")