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

@ -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.
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
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

View File

@ -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")