Pouze v /root/Projekty/discussion/discussionplugin/0.9/tracdiscussion/: console.py
diff /mnt/remote/sshfs/mnt/remote/data/Domovy/root/discussionplugin/0.9/discussion/core.py /root/Projekty/discussion/discussionplugin/0.9/tracdiscussion/core.py
7d6
< from trac.util import Markup
15,16c14
<     implements(INavigationContributor, IRequestHandler, ITemplateProvider,
<       IPermissionRequestor)
---
>     implements(INavigationContributor, IRequestHandler, ITemplateProvider, IPermissionRequestor)
27c25
< 
---
>     
33c31
<     def get_htdocs_dirs(self):
---
>     def get_htdocs_dir(self):
35c33
<         return [('discussion', resource_filename(__name__, 'htdocs'))]
---
>         return resource_filename(__name__, 'htdocs')
37c35
<     def get_templates_dirs(self):
---
>     def get_templates_dir(self):
39c37
<         return [resource_filename(__name__, 'templates')]
---
>         return resource_filename(__name__, 'templates')
49,51c47
<         yield 'mainnav', 'discussion', Markup('<a href="%s">%s</a>' % \
<           (self.env.href.discussion(), self.env.config.get('discussion',
<           'title', 'Discussion')))
---
>         yield 'mainnav', 'discussion', '<a href="%s">%s</a>' % (self.env.href.discussion(), self.env.config.get('discussion', 'title', 'Discussion'))
55,56c51
<         match = re.match(r'''/discussion(?:/?$|/([a-zA-Z]+[-a-zA-Z]+)(?:/?$|/(\d+))(?:/?$|/(\d+)))$''',
< 	  req.path_info)
---
>         match = re.match(r'''/discussion(?:/?$|/([a-z]+[-a-z]+)(?:/?$|/(\d+))(?:/?$|/(\d+)))$''', req.path_info)
68,69c63,64
<         add_stylesheet(req, 'common/css/wiki.css')
<         add_stylesheet(req, 'discussion/css/discussion.css')
---
>         add_stylesheet(req, 'css/wiki.css')
>         add_stylesheet(req, 'css/discussion.css')
78,79c73
<             if not forum: raise TracError('No such forum %s' %
<               req.args['forum'])
---
>             if not forum: raise TracError('No such forum %s' % req.args['forum'])
86,88c80,81
<             if not topic: raise TracError('No such topic %s' %
<                 req.args['topic'])
<               req.hdf['discussion.topic'] = topic
---
>             if not topic: raise TracError('No such topic %s' % req.args['topic'])
>             req.hdf['discussion.topic'] = topic
94,95c87
<             if not message: raise TracError('No such message %s' %
<                req.args['message'])
---
>             if not message: raise TracError('No such message %s' % req.args['message'])
109,110c101
<             req.hdf['discussion.topics'] = self.get_topics(cursor, forum['id'],
<               req)
---
>             req.hdf['discussion.topics'] = self.get_topics(cursor, forum['id'], req)
112,113c103
<             req.hdf['discussion.messages'] = self.get_messages(cursor,
<               topic['id'], req)
---
>             req.hdf['discussion.messages'] = self.get_messages(cursor, topic['id'], req)
120,126c110,115
<         cursor.execute('SELECT id, forum, topic, replyto, time, body, author'
<           'FROM message WHERE id=%s', [id])
<         for row in cursor:
<             row = dict(zip(columns, row))
<             row['body'] = wiki_to_html(row['body'], self.env, req)
<             return row
<         return None
---
>         cursor.execute('SELECT id, forum, topic, replyto, time, body, author FROM message WHERE id=%i', id)
>         row = cursor.fetchone()
>         if not row: return None
>         row = dict(zip(columns, row))
>         row['body'] = wiki_to_html(row['body'], self.env, req)
>         return row
130,136c119,124
<         cursor.execute('SELECT id, forum, time, subject, body, author FROM'
<           ' topic WHERE id=%s', [id])
<         for row in cursor:
<             row = dict(zip(columns, row))
<             row['subject'] = wiki_to_oneliner(row['subject'], self.env)
<             return row
<         return None
---
>         cursor.execute('SELECT id, forum, time, subject, body, author FROM topic WHERE id=%s', id)
>         row = cursor.fetchone()
>         if not row: return None
>         row = dict(zip(columns, row))
>         row['subject'] = wiki_to_oneliner(row['subject'], self.env)
>         return row
139d126
<         self.log.debug('id=%s', str(id))
141,148c128,134
<         cursor.execute('SELECT name, moderators, id, time, subject, description'
<           ' FROM forum WHERE name=%s', [id])
<         for row in cursor:
<             row = dict(zip(columns, row))
<             row['moderators'] = row['moderators'].split(' ')
<             row['subject'] = wiki_to_oneliner(row['subject'], self.env)
<             return row
<         return None
---
>         cursor.execute('SELECT name, moderators, id, time, subject, description FROM forum WHERE name=%s', id)
>         row = cursor.fetchone()
>         if not row: return None
>         row = dict(zip(columns, row))
>         row['moderators'] = row['moderators'].split(' ')
>         row['subject'] = wiki_to_oneliner(row['subject'], self.env)
>         return row
151,156c137,138
<         columns = ('moderators', 'id', 'time', 'subject', 'name',
<           'description', 'topics', 'replies')
<         cursor.execute('SELECT moderators, id, time, subject, name,'
<           ' description, (SELECT COUNT(id) FROM topic t WHERE'
<           ' t.forum=forum.id), (SELECT COUNT(id) FROM message m WHERE m.forum'
<           ' = forum.id) FROM forum ORDER BY subject')
---
>         columns = ('moderators', 'id', 'time', 'subject', 'name', 'description', 'topics', 'replies')
>         cursor.execute('SELECT moderators, id, time, subject, name, description, (SELECT COUNT(id) FROM topic t WHERE t.forum=forum.id), (SELECT COUNT(id) FROM message m WHERE m.forum = forum.id) FROM forum ORDER BY subject')
158c140
<         for row in cursor:
---
>         for row in cursor.fetchall():
167,169c149
<         cursor.execute('SELECT id, forum, time, subject, body, author, (SELECT'
<           ' COUNT(id) FROM message m WHERE m.topic = topic.id) FROM topic'
<           ' WHERE forum = %s ORDER BY time', [forum])
---
>         cursor.execute('SELECT id, forum, time, subject, body, author, (SELECT COUNT(id) FROM message m WHERE m.topic = topic.id) FROM topic WHERE forum = %i ORDER BY time', int(forum))
171c151
<         for row in cursor:
---
>         for row in cursor.fetchall():
179,180c159
<         cursor.execute('SELECT id, replyto, time, body, author FROM message'
<           ' WHERE topic=%s ORDER BY time', [topic])
---
>         cursor.execute('SELECT id, replyto, time, body, author FROM message WHERE topic=%s ORDER BY time', topic)
185c164
<         for message in cursor:
---
>         for message in cursor.fetchall():
diff /mnt/remote/sshfs/mnt/remote/data/Domovy/root/discussionplugin/0.9/discussion/db.py /root/Projekty/discussion/discussionplugin/0.9/tracdiscussion/db.py
8,29c8,30
<   Table('forum', key='id')[
<     Column('id', type='int', auto_increment = True),
<     Column('name'),
<     Column('time', type='int'),
<     Column('moderators'),
<     Column('subject'),
<     Column('description')],
<   Table('topic', key='id')[
<     Column('id', type='int', auto_increment = True),
<     Column('forum', type='int'),
<     Column('time', type='int'),
<     Column('author'),
<     Column('subject'),
<     Column('body')],
<   Table('message', key='id')[
<     Column('id', type='int', auto_increment = True),
<     Column('forum', type='int'),
<     Column('topic', type='int'),
<     Column('replyto', type='int'),
<     Column('time', type='int'),
<     Column('author'),
<     Column('body')]]
---
>     Table('forum', key=('id', 'name'))[
>         Column('id', type='int', auto_increment = True),
>         Column('name'),
>         Column('time', type='int'),
>         Column('moderators'),
>         Column('subject'),
>         Column('description')],
>     Table('topic', key = 'id')[
>         Column('id', type='int', auto_increment = True),
>         Column('forum', type='int'),
>         Column('time', type='int'),
>         Column('author'),
>         Column('subject'),
>         Column('body')],
>     Table('message', key = 'id')[
>         Column('id', type='int', auto_increment = True),
>         Column('forum', type='int'),
>         Column('topic', type='int'),
>         Column('replyto', type='int'),
>         Column('time', type='int'),
>         Column('author'),
>         Column('body')],
> ]
Spoleèné podadresáøe: /mnt/remote/sshfs/mnt/remote/data/Domovy/root/discussionplugin/0.9/discussion/htdocs a /root/Projekty/discussion/discussionplugin/0.9/tracdiscussion/htdocs
diff /mnt/remote/sshfs/mnt/remote/data/Domovy/root/discussionplugin/0.9/discussion/init.py /root/Projekty/discussion/discussionplugin/0.9/tracdiscussion/init.py
2d1
< from trac.db import *
13c12
< 
---
>     
19,21c18,19
<             for row in cursor:
<                 return int(row[0]) != discussion_version
<             return True
---
>             version = int(cursor.fetchone()[0])
>             return version != discussion_version
25c23
< 
---
>     
29,37c27,35
<         #try:
<         for table in schema:
<             queries = db.to_sql(table)
<             for query in queries:
<                 cursor.execute(query)
<         cursor.execute("INSERT INTO system VALUES ('discussion_version', %s)",
<           [discussion_version])
<         #except:
<           #cursor.execute("UPDATE system SET value = %i WHERE name = 'discussion_version'", discussion_version)
---
>         try:
>             for table in schema:
>                 cursor.execute(db.to_sql(table))
>             cursor.execute("INSERT INTO system VALUES ('discussion_version', %i)", discussion_version)
>         except:
>             # Upgrade
>             # TODO Table upgrades...
>             cursor.execute("UPDATE system SET value = %i WHERE name = 'discussion_version'", discussion_version)
>         db.commit()
diff /mnt/remote/sshfs/mnt/remote/data/Domovy/root/discussionplugin/0.9/discussion/__init__.py /root/Projekty/discussion/discussionplugin/0.9/tracdiscussion/__init__.py
1c1
< from discussion import init, core, wiki
---
> from discussion import init, core, wiki, console
Pouze v /mnt/remote/sshfs/mnt/remote/data/Domovy/root/discussionplugin/0.9/discussion: .svn
Spoleèné podadresáøe: /mnt/remote/sshfs/mnt/remote/data/Domovy/root/discussionplugin/0.9/discussion/templates a /root/Projekty/discussion/discussionplugin/0.9/tracdiscussion/templates
