import argparse
import os
from actions import server, client

# the main entry point for the application
# for simplicity, let's decide that the user decides at runtime to listen
# and the server decides to serve

# location from which files should be served
app_directory = '/home/chris/blaster'

def main():
    # get the arguments
    parser = argparse.ArgumentParser(description="Exchange files!")
    parser.add_argument('action',
                        help="To be the server, type serve; to be the client, type listen",
                        )
    args = parser.parse_args()
    app_runner(args.action)

def app_runner(how):
    if how == "serve":
        if os.path.exists(app_directory) == False:
            os.mkdir(app_directory)
        server.main(app_directory)
    elif how == "listen":
        client.main()
    else:
        return u'Please specify either listen or serve'
    

if __name__  == '__main__':
    main()

@@ -252,16 +252,17 @@
  served%0A
+_
 app_dire
@@ -583,16 +583,17 @@
 s()%0A    
+_
 app_runn
@@ -613,16 +613,17 @@
 n)%0A%0Adef 
+_
 app_runn
@@ -680,16 +680,17 @@
 .exists(
+_
 app_dire
@@ -727,16 +727,17 @@
 s.mkdir(
+_
 app_dire
@@ -763,16 +763,17 @@
 er.main(
+_
 app_dire

make several functions and variables private