• R/O
  • SSH

execsql: Commit

Default repository for execsql.py


Commit MetaInfo

Revision1a3ee257309d42057f8caf2c4f75a7c47bb4656d (tree)
Time2020-10-18 10:49:16
Authorrdnielsen
Commiterrdnielsen

Log Message

Propagated metacommandline to IF test functions.

Change Summary

Incremental Difference

diff -r c9e4ebf0c4c2 -r 1a3ee257309d execsql/execsql.py
--- a/execsql/execsql.py Sat Oct 03 14:07:59 2020 -0700
+++ b/execsql/execsql.py Sat Oct 17 18:49:16 2020 -0700
@@ -27,12 +27,12 @@
2727 #
2828 # ===============================================================================
2929
30-__version__ = "1.79.2"
31-__vdate = "2020-10-03"
30+__version__ = "1.79.3"
31+__vdate = "2020-10-17"
3232
3333 primary_vno = 1
3434 secondary_vno = 79
35-tertiary_vno = 2
35+tertiary_vno = 3
3636
3737 import os
3838 import os.path
@@ -1063,12 +1063,12 @@
10631063 def close(self):
10641064 if self.log_file:
10651065 self.log_file.close()
1066- try:
1067- #os.chmod(self.log_file_name, os.stat(self.log_file_name).st_mode & ~stat.S_IRUSR)
1068- os.chmod(self.log_file_name, os.stat(self.log_file_name).st_mode & ~stat.S_IREAD)
1069- except:
1070- # Ignore the exception if we can't set it to read-only.
1071- pass
1066+ #try:
1067+ # #os.chmod(self.log_file_name, os.stat(self.log_file_name).st_mode & ~stat.S_IRUSR)
1068+ # os.chmod(self.log_file_name, os.stat(self.log_file_name).st_mode & ~stat.S_IREAD)
1069+ #except:
1070+ # # Ignore the exception if we can't set it to read-only.
1071+ # pass
10721072 self.log_file = None
10731073 def log_db_connect(self, db):
10741074 self.seq_no += 1
@@ -7831,6 +7831,7 @@
78317831 class CondParser(CondTokens, object):
78327832 # Takes a conditional expression string.
78337833 def __init__(self, condexpr):
7834+ self.condexpr = condexpr
78347835 self.cond_expr = SourceString(condexpr)
78357836 def match_metacommand(self, metacmd):
78367837 # Tries to match the regex of the 'metacmd' argument at the current
@@ -7879,6 +7880,7 @@
78797880 # Match_any_metacommand -- returns a tuple consisting of (metacommand, groupdict)
78807881 m1 = self.match_any_metacommand(conditionals)
78817882 if m1 is not None:
7883+ m1[1]["metacommandline"] = self.condexpr
78827884 return CondAstNode(self.CONDITIONAL, m1, None)
78837885 else:
78847886 if self.cond_expr.match_str("(") is not None:
diff -r c9e4ebf0c4c2 -r 1a3ee257309d setup.py
--- a/setup.py Sat Oct 03 14:07:59 2020 -0700
+++ b/setup.py Sat Oct 17 18:49:16 2020 -0700
@@ -5,7 +5,7 @@
55 long_description = f.read()
66
77 setuptools.setup(name='execsql',
8- version='1.79.2',
8+ version='1.79.3',
99 description="Runs a SQL script against a PostgreSQL, MS-Access, SQLite, MS-SQL-Server, MySQL, MariaDB, Firebird, or Oracle database, or an ODBC DSN. Provides metacommands to import and export data, copy data between databases, conditionally execute SQL and metacommands, and dynamically alter SQL and metacommands with substitution variables. Data can be exported in 18 different formats, including CSV, TSV, ODS, HTML, JSON, LaTeX, and Markdown tables, and using custom templates.",
1010 author='Dreas Nielsen',
1111 author_email='dreas.nielsen@gmail.com',
Show on old repository browser