|
a/scripts/rethumb.py |
|
b/scripts/rethumb.py |
|
... |
|
... |
16 |
# under the License.
|
16 |
# under the License.
|
17 |
|
17 |
|
18 |
import sys
|
18 |
import sys
|
19 |
import time
|
19 |
import time
|
20 |
|
20 |
|
21 |
import pkg_resources
|
|
|
22 |
import PIL
|
21 |
import PIL
|
23 |
import tg
|
22 |
import tg
|
24 |
from pylons import tmpl_context as c
|
23 |
from pylons import tmpl_context as c
|
25 |
from paste.deploy.converters import asint
|
24 |
from paste.deploy.converters import asint
|
26 |
|
25 |
|
27 |
from ming.orm import mapper, ThreadLocalORMSession, session, state, Mapper
|
26 |
from ming.orm import mapper, ThreadLocalORMSession, session, state, Mapper
|
|
|
27 |
|
28 |
from allura.command import base
|
28 |
from allura.command import base
|
|
|
29 |
from allura.lib.helpers import iter_entry_points
|
|
|
30 |
|
29 |
import forgetracker.model
|
31 |
import forgetracker.model
|
30 |
|
32 |
|
31 |
|
33 |
|
32 |
class RethumbCommand(base.Command):
|
34 |
class RethumbCommand(base.Command):
|
33 |
min_args=1
|
35 |
min_args=1
|
|
... |
|
... |
107 |
|
109 |
|
108 |
# Any application may contain DiscussionAttachment's, it has discussion_id field
|
110 |
# Any application may contain DiscussionAttachment's, it has discussion_id field
|
109 |
self.process_att_of_type(M.DiscussionAttachment, {'app_config_id': app._id, 'discussion_id': {'$ne': None}})
|
111 |
self.process_att_of_type(M.DiscussionAttachment, {'app_config_id': app._id, 'discussion_id': {'$ne': None}})
|
110 |
|
112 |
|
111 |
# Otherwise, we'll take attachment classes belonging to app's package
|
113 |
# Otherwise, we'll take attachment classes belonging to app's package
|
112 |
ep = pkg_resources.iter_entry_points('allura', app.tool_name).next()
|
114 |
ep = iter_entry_points('allura', app.tool_name).next()
|
113 |
app_package = ep.module_name.split('.', 1)[0]
|
115 |
app_package = ep.module_name.split('.', 1)[0]
|
114 |
if app_package == 'allura':
|
116 |
if app_package == 'allura':
|
115 |
# Apps in allura known to not define own attachment types
|
117 |
# Apps in allura known to not define own attachment types
|
116 |
continue
|
118 |
continue
|
117 |
|
119 |
|