changeset 31:443a0001d841 draft header-includes

Improve the #include syntax a bit.
author David Barts <n5jrn@me.com>
date Mon, 27 May 2019 15:17:25 -0700
parents f34d5a90d618
children 3382799f3905
files tincan.py
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/tincan.py	Mon May 27 14:58:40 2019 -0700
+++ b/tincan.py	Mon May 27 15:17:25 2019 -0700
@@ -336,13 +336,15 @@
             self.in_lib = True
         else:
             self.in_lib = False
-        comma = raw.find(',')
-        if comma < 0:
-            raise ValueError("missing comma")
-        self.vname = raw[:comma]
+        equals = raw.find('=')
+        if equals < 0:
+            self.vname = os.path.splitext(raw)[0]
+            self.fname = raw
+        else:
+            self.vname = raw[:equals]
+            self.fname = raw[equals+1:]
         if self.vname == "":
             raise ValueError("empty variable name")
-        self.fname = raw[comma+1:]
         if self.fname == "":
             raise ValueError("empty file name")
         if not self.fname.endswith(_IEXTEN):