~vomun-developers/anonplus/vomun-trunk

« back to all changes in this revision

Viewing changes to src/vomun.py

  • Committer: AJ00200
  • Date: 2011-11-25 21:30:53 UTC
  • Revision ID: git-v1:adec72eb3a3f154a85bce3e01e408b6e40b3d3da
Basic structure for database storage. Also added a start function.

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