Last active 1748863688

cmd.py Raw
1#!/usr/bin/env python3
2#coding:utf-8
3
4import cmd
5
6completions = [
7 'Mage Slayer (Alara Reborn)',
8 'Magefire Wings (Alara Reborn)',
9 'Sages of the Anima (Alara Reborn)',
10 'Sanctum Plowbeast (Alara Reborn)',
11 'Sangrite Backlash (Alara Reborn)',
12 'Sanity Gnawers (Alara Reborn)',
13 'Sen Triplets (Alara Reborn)'
14]
15
16class principale(cmd.Cmd):
17 intro = "bonjour"
18 prompt = "(principal) "
19
20 def do_add(self, arg):
21 pass
22
23 def complete_add(self, text, line, begidx, endidx):
24 mline = line.partition(' ')[2]
25 offs = len(mline) - len(text)
26 return [s[offs:] for s in completions if s.startswith(mline)]
27
28 def do_secondaire(self, arg):
29 secondaire().cmdloop()
30
31 def do_exit(self, arg):
32 return True
33
34 def do_q(self, arg):
35 return True
36
37class secondaire(cmd.Cmd):
38 prompt = "(principale - secondaire) "
39
40 def do_exit(self, arg):
41 return True
42
43principale().cmdloop()