-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcmd.py
47 lines (41 loc) · 1.08 KB
/
cmd.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
""" Example file to show the difference of the cmd command
"""
# import and init advcubit
import advcubit
advcubit.init(None, False)
import cubit
# start cubit
advcubit.startCubit()
# use the originally cmd function
print('First try the original cmd')
try:
# execute a wrong command
cubit.cmd('this is not a command')
# passed command, print it
print('#' * 80)
print('No error found in cubit.cmd')
# catch a possible error
except Exception as e:
print('#' * 80)
print('We got an error with cubit.cmd:\n' + str(e))
# print that we are done
print('Done!!!')
print('#' * 80)
# use the advanced cmd function
print('Lets try the advcubit cmd')
try:
# execute a wrong command
advcubit.cmd('this is not a command')
# passed command, print it
print('#' * 80)
print('No error found in advcubit.cmd')
# catch a possible error
except Exception as e:
print('#' * 80)
print('We got an error with advcubit.cmd:\n' + str(e))
# print that we are done
print('Done!!!')
print('#' * 80)
# close cubit and clean
advcubit.closeCubit()
advcubit.deleteJournalFiles()