Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
dc48eeea
Commit
dc48eeea
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
fix static variable usage
parent
f593c5c2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/caps.py
+8
-8
8 additions, 8 deletions
src/common/caps.py
with
8 additions
and
8 deletions
src/common/caps.py
+
8
−
8
View file @
dc48eeea
...
...
@@ -80,11 +80,6 @@ class CapsCache(object):
def
__init__
(
self
,
logger
=
None
):
'''
Create a cache for entity capabilities.
'''
# our containers:
# __names is a string cache; every string long enough is given
# another object, and we will have plenty of identical long
# strings. therefore we can cache them
# TODO: maybe put all known xmpp namespace strings here
# (strings given in xmpppy)?
# __cache is a dictionary mapping: pair of node and version maps
# to CapsCacheItem object
# __CacheItem is a class that stores data about particular
...
...
@@ -93,7 +88,12 @@ class CapsCache(object):
class
CacheItem
(
object
):
'''
TODO: logging data into db
'''
self
.
__names
=
{}
# __names is a string cache; every string long enough is given
# another object, and we will have plenty of identical long
# strings. therefore we can cache them
# TODO: maybe put all known xmpp namespace strings here
# (strings given in xmpppy)?
__names
=
{}
def
__init__
(
ciself
,
hash_method
,
hash
):
# cached into db
ciself
.
hash_method
=
hash_method
...
...
@@ -113,7 +113,7 @@ class CapsCache(object):
def
_set_features
(
ciself
,
value
):
ciself
.
_features
=
[]
for
feature
in
value
:
ciself
.
_features
.
append
(
self
.
__names
.
setdefault
(
feature
,
ciself
.
_features
.
append
(
ci
self
.
__names
.
setdefault
(
feature
,
feature
))
features
=
property
(
_get_features
,
_set_features
)
...
...
@@ -122,7 +122,7 @@ class CapsCache(object):
def
_set_identities
(
ciself
,
value
):
ciself
.
_identities
=
[]
for
identity
in
value
:
ciself
.
_identities
.
append
(
self
.
__names
.
setdefault
(
identity
,
ciself
.
_identities
.
append
(
ci
self
.
__names
.
setdefault
(
identity
,
identity
))
identities
=
property
(
_get_identities
,
_set_identities
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment