X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=bin%2Fmudpy;h=d7ec045a93fe0a9636ba9335caff0536349039e8;hp=040c5f8f639bb8f15fe4b7228bf218a8ec1d1bf1;hb=91ddbb70b5f3916ba9c13f9cb05528285d10ad5c;hpb=b6b6478cf56b8d0defd158868c91f88c150313ed diff --git a/bin/mudpy b/bin/mudpy index 040c5f8..d7ec045 100755 --- a/bin/mudpy +++ b/bin/mudpy @@ -1,7 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Skeletal executable for the mudpy engine.""" -# Copyright (c) 2004-2015 Jeremy Stanley . Permission +# Copyright (c) 2004-2016 Jeremy Stanley . Permission # to use, copy, modify, and distribute this software is granted under # terms provided in the LICENSE file distributed with this software. @@ -9,25 +9,33 @@ import imp import os import sys -sys.path.append(os.path.realpath("lib")) +sys.path.append(os.path.realpath(".")) import mudpy -# start it up -mudpy.misc.setup() -# loop indefinitely while the world is not flagged for termination or -# there are still connected users -while not mudpy.misc.universe.terminate_flag or mudpy.misc.universe.userlist: +def main(): - # the world was flagged for a reload of all code/data - if mudpy.misc.universe.reload_flag: - imp.reload(mudpy) - mudpy.misc.reload_data() - mudpy.misc.universe.reload_flag = False + # start it up + mudpy.misc.setup() - # do what needs to be done on each pulse - mudpy.misc.on_pulse() + # loop indefinitely while the world is not flagged for termination or + # there are still connected users + while (not mudpy.misc.universe.terminate_flag or + mudpy.misc.universe.userlist): -# shut it all down -mudpy.misc.finish() + # the world was flagged for a reload of all code/data + if mudpy.misc.universe.reload_flag: + imp.reload(mudpy) + mudpy.misc.reload_data() + mudpy.misc.universe.reload_flag = False + + # do what needs to be done on each pulse + mudpy.misc.on_pulse() + + # shut it all down + mudpy.misc.finish() + + +if __name__ == '__main__': + sys.exit(main())