Passed
Branch master (0fb205)
by Oleksandr
03:17
created

commons.SupportedLanguages.get_default()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nop 1
crap 1
1 1
from candv import Constants
2 1
from candv import SimpleConstant
3 1
from candv import Values
4 1
from candv import VerboseValueConstant
5 1
from candv import with_constant_class
6
7 1
from ._translations import gettext_lazy as _
8
9
10 1
class SupportedLanguage(SimpleConstant):
11 1
  ...
12
13
14 1
class SupportedLanguages(with_constant_class(SupportedLanguage), Constants):
15 1
  en = SupportedLanguage()
16 1
  ru = SupportedLanguage()
17
18 1
  @classmethod
19 1
  def get_default(cls):
20 1
    return cls.en
21
22
23 1
class Skill(VerboseValueConstant):
24 1
  ...
25
26
27 1
class Skills(with_constant_class(Skill), Values):
28 1
  rookie  = Skill(0, _("rookie"))
29 1
  average = Skill(1, _("average"))
30 1
  veteran = Skill(2, _("veteran"))
31 1
  ace     = Skill(3, _("ace"))
32
33
34 1
class UnitType(VerboseValueConstant):
35 1
  ...
36
37
38 1
class UnitTypes(with_constant_class(UnitType), Values):
39 1
  aircraft   = UnitType('planes',      _("aircraft"))
40 1
  armor      = UnitType('armor',       _("armor"))
41 1
  artillery  = UnitType('artillery',   _("artillery"))
42 1
  balloon    = UnitType('aeronautics', _("balloon"))
43 1
  light      = UnitType('lights',      _("light"))
44 1
  radio      = UnitType('radios',      _("radio"))
45 1
  ship       = UnitType('ships',       _("ship"))
46 1
  stationary = UnitType('stationary',  _("stationary"))
47 1
  train      = UnitType('trains',      _("train"))
48 1
  vehicle    = UnitType('vehicles',    _("vehicle"))
49
50
51 1
class MissionStatus(SimpleConstant):
52 1
  ...
53
54
55 1
class MissionStatuses(with_constant_class(MissionStatus), Constants):
56 1
  not_loaded = MissionStatus()
57 1
  loaded     = MissionStatus()
58
  playing    = MissionStatus()
59