prepare to move body code into main function
authorClaudio Luck <claudio.luck@pep.foundation>
Tue, 04 Sep 2018 16:52:30 +0200
changeset 53 b94d4c5b9496
parent 52 b4a9a3122abb
child 54 cefcaac752c9
prepare to move body code into main function
yml2/yml2c
yml2/yml2proc
--- a/yml2/yml2c	Tue Sep 04 16:48:59 2018 +0200
+++ b/yml2/yml2c	Tue Sep 04 16:52:30 2018 +0200
@@ -28,6 +28,10 @@
         msg = codecs.encode(msg, sys.stderr.encoding)
     sys.stderr.write(msg)
 
+
+def main():
+    pass
+
 optParser = OptionParser()
 optParser.add_option("-C", "--old-syntax", action="store_true", dest="old_syntax",
         help="syntax of YML 2 version 1.x (compatibility mode)", default=False)
@@ -94,3 +98,7 @@
 except Exception as msg:
     w(msg)
     sys.exit(5)
+
+
+if __name__ == "__main__":
+    sys.exit(main())
--- a/yml2/yml2proc	Tue Sep 04 16:48:59 2018 +0200
+++ b/yml2/yml2proc	Tue Sep 04 16:52:30 2018 +0200
@@ -37,6 +37,10 @@
         msg = codecs.encode(msg, sys.stderr.encoding)
     sys.stderr.write(msg)
 
+
+def main():
+    pass
+
 optParser = OptionParser()
 optParser.add_option("-C", "--old-syntax", action="store_true", dest="old_syntax",
         help="syntax of YML 2 version 1.x (compatibility mode)", default=False)
@@ -240,3 +244,8 @@
 except Exception as msg:
     w(msg)
     sys.exit(5)
+
+
+if __name__ == "__main__":
+    sys.exit(main())
+