Skip to content

Commit 9ce1208

Browse files
committed
Remove commands used only in internal DB
1 parent acb1a06 commit 9ce1208

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
## v1.4.4
55
#### 2018-XXX-XX
6+
- Improved version to work with public release DB
67
- Update dtypes to match Y3 tables (PR #149)
78
- Fix bytes to unicode issue for py3 when writing h5 files
89
- Fix bug with Oracle types NUMBER with no scale/digits

easyaccess/eaparser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ def get_args(config_file):
2929
parser.add_argument("-lt", "--load_table", dest='loadtable',
3030
help="Loads data from a csv, tab, or fits formatted file \
3131
into a DB table using the filename as the table name or a custom \
32-
name with --tablename MYTABLE")
32+
name with --tablename MYTABLE. Not available in desdr.")
3333
parser.add_argument("-at", "--append_table", dest='appendtable',
3434
help="Appends data from a csv, tab, or fits formatted file \
3535
into a DB table using the filename as the table name or a custom \
36-
name with --tablename MYABLE")
36+
name with --tablename MYABLE. Not available in desdr.")
3737
parser.add_argument("--tablename", dest='tablename',
3838
help="Custom table name to be used with --load_table\
39-
or --append_table")
39+
or --append_table. Not available in desdr.")
4040
parser.add_argument("--chunksize", dest='chunksize', type=int, default=None,
4141
help="Number of rows to be inserted at a time. Useful for large files "
4242
"that do not fit in memory. Use with --load_table or --append_table")

easyaccess/easyaccess.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ def colored(line, color, mode=0):
6666
negative = ['no', 'n', 'false', 'f', 'off']
6767
input_options = ', '.join([i[0]+'/'+i[1] for i in zip(positive, negative)])
6868

69+
# commands not available in public DB
70+
NOT_PUBLIC = ['add_comment', 'append_table', 'change_db', 'execproc', 'find_user', 'load_table',
71+
'myquota', 'mytables', 'user_tables']
72+
6973
sys.path.insert(0, os.getcwd())
7074
# For python functions to work
7175
fun_utils.init_func()
@@ -344,6 +348,9 @@ def do_help(self, arg):
344348
doc = str(doc)
345349
if doc.find('DB:') > -1:
346350
doc = doc.replace('DB:', '')
351+
if arg in NOT_PUBLIC and self.dbname == 'desdr':
352+
doc = colored('\n\t* Command not availble in Public Release DB *\n',
353+
'red', self.ct) + doc
347354
self.stdout.write("%s\n" % str(doc))
348355
return
349356
except AttributeError:
@@ -372,6 +379,8 @@ def do_help(self, arg):
372379
continue
373380
prevname = name
374381
cmd = name[3:]
382+
if cmd in NOT_PUBLIC and self.dbname == 'desdr':
383+
continue
375384
if cmd in help:
376385
cmds_doc.append(cmd)
377386
del help[cmd]

0 commit comments

Comments
 (0)