~vomun-developers/anonplus/vomun-trunk

« back to all changes in this revision

Viewing changes to src/libs/morado/functions.py

  • Committer: AJ00200
  • Date: 2011-11-25 21:51:13 UTC
  • mfrom: (161.1.1)
  • Revision ID: git-v1:073014d0b3140afbc0bb2f05ef5efd2d655bbd00
Merge branch 'master' into storage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
 
import libs
 
2
import libs.globals
3
3
import libs.threadmanager
4
4
 
5
 
libs.globals['apifunctions'] = {}
 
5
libs.globals.global_vars["apifunctions"] = {}
6
6
 
7
7
def register_with_api(func):
8
 
    libs.globals['apifunctions'][func.__name__] = func
 
8
    libs.globals.global_vars["apifunctions"][func.__name__] = func
9
9
    return func
10
10
 
11
11
@register_with_api
12
12
def get_functions():
13
13
    '''lists the api functions'''
14
 
    return [func.__name__ for func in libs.globals['apifunctions'].values()]
 
14
    return [func.__name__ for func in libs.globals.global_vars['apifunctions'].values()]
15
15
 
16
16
@register_with_api
17
17
def help(funcname):
21
21
            func = f
22
22
            break
23
23
    return func.__doc__
24
 
 
 
24
     
25
25
@register_with_api
26
26
def shutdown():
27
27
    '''shuts down the server'''
33
33
@register_with_api
34
34
def get_build():
35
35
    '''Return the build number'''
36
 
    return libs.globals['anon+']['BUILD']
37
 
 
38
 
# Functions for the config file
39
 
@register_with_api
40
 
def reload_config():
41
 
    '''Reload the configuration file.'''
42
 
    libs.config.load()
43
 
 
44
 
@register_with_api
45
 
def get_config():
46
 
    '''Return the contents of the configuration file.'''
47
 
    return libs.config
48
 
 
49
 
@register_with_api
50
 
def save_config():
51
 
    '''Save the contents of the configuration file.'''
52
 
    libs.config.save()
 
36
    return libs.globals.global_vars['anon+']['BUILD']