• R/O
  • SSH

un-xtab: 提交

Source, documentation, and distribution code for un-xtab.py


Commit MetaInfo

修訂6baeae66ed1d54aabe82e10bca80154db83d2dbc (tree)
時間2022-02-02 11:09:21
作者rdnielsen
Commiterrdnielsen

Log Message

Revisions for backwards-incompatible Python changes.

Change Summary

差異

diff -r cb48afc3993f -r 6baeae66ed1d un-xtab/un-xtab.py
--- a/un-xtab/un-xtab.py Tue Feb 01 07:45:37 2022 -0800
+++ b/un-xtab/un-xtab.py Tue Feb 01 18:09:21 2022 -0800
@@ -58,7 +58,8 @@
5858 # 2019-09-11 Modified to allow column IDs for the "data_columns" setting to be
5959 # letters as well as numbers. RDN.
6060 # 2021-08-16 Modified to seek(0) in the output buffer before truncating it. RDN.
61-# 2022-02-01 Modified to use argparse instead of optparse. RDN.
61+# 2022-02-01 Corrected setting of error_type. Modified to use argparse instead of optparse.
62+# Replaced "string.letters", which no longer exists. RDN.
6263 #=====================================================================================
6364
6465
@@ -160,6 +161,8 @@
160161 self.program_name=program_name
161162 if error_type is not None:
162163 self.error_type=error_type.__name__
164+ else:
165+ self.error_type = '(unknown)'
163166 self.error_value=error_value,
164167 self.source_lno=source_lno
165168 self.source_txt=source_txt
@@ -433,7 +436,8 @@
433436 def letters_to_decimal(col_id):
434437 """Converts a spreadsheet column ID, consisting of one or more letters,
435438 into the decimal equivalent."""
436- ltrs = string.letters[:26]
439+ #ltrs = string.letters[:26]
440+ ltrs = 'abcdefghijklmnopqrstuvwxyz'
437441 val = 0
438442 for c in col_id.lower():
439443 val = val * 26 + ltrs.index(c) + 1
@@ -773,9 +777,6 @@
773777 if opts.showspecs:
774778 print(CONFIG_KEYWORDS)
775779 return 0
776- if len(opts) == 0:
777- parser.print_help()
778- return 0
779780 common["printconfig"] = opts.printconfig
780781 common["printheaders"] = opts.printheaders
781782 # Check for two filename arguments, the first of which is an existing file.
Show on old repository browser