~vomun-developers/anonplus/vomun-trunk

« back to all changes in this revision

Viewing changes to src/vomun.py

  • Committer: AJ00200
  • Date: 2011-11-26 00:03:57 UTC
  • Revision ID: git-v1:f4f4352eb338a5f57a5a92e4bf23bec36d298d13
Blocks we receive are now stored in ~/.vomun/blocks.json. libs.globals and libs.config are now used directly after importing libs; they are set in libs/__init__.py now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
run them.'''
4
4
import time
5
5
 
6
 
import libs.globals
7
 
 
8
 
print(libs.globals.global_vars['anon+']['banner'] % 
9
 
        (libs.globals.global_vars['anon+']['VERSION'], 
10
 
        libs.globals.global_vars['anon+']['BUILD']))
11
 
        
 
6
import libs
 
7
 
 
8
print(libs.globals['anon+']['banner'] %
 
9
        (libs.globals['anon+']['VERSION'],
 
10
        libs.globals['anon+']['BUILD']))
 
11
 
12
12
import libs.threadmanager
13
13
import libs.browser
14
14
import libs.events
15
15
import libs.logs
16
 
import libs.config
17
16
 
18
17
print('''
19
18
     == Warning! ==
29
28
    # Create the API Server. Used by external Applications.
30
29
    #import api.server
31
30
    #api.server.start()
32
 
    
 
31
 
33
32
    import libs.morado.morado
34
33
    libs.morado.morado.start()
35
34
 
42
41
    # Load and prepare our list of friends
43
42
    import libs.friends as friends
44
43
    friends.load_friends()
45
 
    
 
44
 
46
45
    # Load connection handlers and start
47
46
    import tunnels.directudp
48
47
    tunnels.directudp.start()
49
 
    
 
48
 
50
49
    # Start the web interface
51
50
    import uis.web.manager
52
51
    uis.web.manager.start()
53
 
    
 
52
 
54
53
    libs.browser.open('http://localhost:7777/')
55
 
    
 
54
 
56
55
    # Start the storage database
57
56
    import libs.storage.manager
58
57
    libs.storage.manager.start()
59
 
    
 
58
 
60
59
    # Start the API
61
60
    ## main loop
62
 
    while libs.globals.global_vars['running']:
 
61
    while libs.globals['running']:
63
62
        time.sleep(1)
64
 
    
 
63
 
65
64
    ## cleanup
 
65
    libs.events.broadcast('shutdown')
66
66
    libs.threadmanager.killall()
67
67
    libs.threadmanager.close_sockets()
68
68
    friends.save_friends()
69
 
    libs.config.save_config()
70
 
    
 
69
    libs.config.save()
 
70
 
71
71
    exit()
72
72