Mercurial > p > roundup > code
comparison roundup/admin.py @ 7546:534f8bdb8f94
Add -P pragma=value command line option to roundup-admin.
To set pragmas when using non-interactive mode, or set on command line
when going into interactive mode.
Also changed specification test to use command line pragma setting
rather than interactive. This tests the -P option without having to
run an extra test.
Docs updated as well.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 14 Jul 2023 00:30:44 -0400 |
| parents | 939fcfdfa370 |
| children | c8c4514f4c3e |
comparison
equal
deleted
inserted
replaced
| 7545:939fcfdfa370 | 7546:534f8bdb8f94 |
|---|---|
| 171 -c -- when outputting lists of data, comma-separate them. | 171 -c -- when outputting lists of data, comma-separate them. |
| 172 Same as '-S ","'. | 172 Same as '-S ","'. |
| 173 -S <string> -- when outputting lists of data, string-separate them | 173 -S <string> -- when outputting lists of data, string-separate them |
| 174 -s -- when outputting lists of data, space-separate them. | 174 -s -- when outputting lists of data, space-separate them. |
| 175 Same as '-S " "'. | 175 Same as '-S " "'. |
| 176 -P pragma=value -- Set a pragma on command line rather than interactively. | |
| 177 Can be used multiple times. | |
| 176 -V -- be verbose when importing | 178 -V -- be verbose when importing |
| 177 -v -- report Roundup and Python versions (and quit) | 179 -v -- report Roundup and Python versions (and quit) |
| 178 | 180 |
| 179 Only one of -s, -c or -S can be specified. | 181 Only one of -s, -c or -S can be specified. |
| 180 | 182 |
| 2112 self.db.commit() | 2114 self.db.commit() |
| 2113 return 0 | 2115 return 0 |
| 2114 | 2116 |
| 2115 def main(self): | 2117 def main(self): |
| 2116 try: | 2118 try: |
| 2117 opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdsS:vV') | 2119 opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdP:sS:vV') |
| 2118 except getopt.GetoptError as e: | 2120 except getopt.GetoptError as e: |
| 2119 self.usage(str(e)) | 2121 self.usage(str(e)) |
| 2120 return 1 | 2122 return 1 |
| 2121 | 2123 |
| 2122 # handle command-line args | 2124 # handle command-line args |
| 2158 self.usage('Only one of -c, -S and -s may be specified') | 2160 self.usage('Only one of -c, -S and -s may be specified') |
| 2159 return 1 | 2161 return 1 |
| 2160 self.separator = ' ' | 2162 self.separator = ' ' |
| 2161 elif opt == '-d': | 2163 elif opt == '-d': |
| 2162 self.print_designator = 1 | 2164 self.print_designator = 1 |
| 2165 elif opt == '-P': | |
| 2166 self.do_pragma([arg]) | |
| 2163 elif opt == '-u': | 2167 elif opt == '-u': |
| 2164 login_opt = arg.split(':') | 2168 login_opt = arg.split(':') |
| 2165 self.name = login_opt[0] | 2169 self.name = login_opt[0] |
| 2166 if len(login_opt) > 1: | 2170 if len(login_opt) > 1: |
| 2167 self.password = login_opt[1] | 2171 self.password = login_opt[1] |
