Browse Source

delete old code

ArnAud 9 years ago
parent
commit
179d0c3a7e

+ 0
- 0
Lodel/management/__init__.py View File


+ 0
- 0
Lodel/management/commands/__init__.py View File


+ 0
- 137
Lodel/management/commands/emgen.py View File

@@ -1,137 +0,0 @@
1
-from django.core.management.base import BaseCommand, CommandError
2
-from optparse import make_option
3
-from EditorialModel.randomem import RandomEm
4
-from EditorialModel.backend.json_backend import EmBackendJson
5
-from EditorialModel.backend.dummy_backend import EmBackendDummy
6
-from EditorialModel.backend.graphviz import EmBackendGraphviz
7
-
8
-
9
-class Command(BaseCommand):
10
-    option_list = BaseCommand.option_list + (
11
-        make_option('--no-classes',
12
-            action='store',
13
-            dest='classtype',
14
-            default = 0,
15
-            help='Chances for a classtype to be empty',
16
-            type="int",
17
-            metavar="INT",
18
-        ),
19
-        make_option('--max-classes',
20
-            action='store',
21
-            dest='nclass',
22
-            default = 3,
23
-            help='Maximum number of classes per classtype',
24
-            type="int",
25
-            metavar="INT",
26
-        ),
27
-        make_option('--no-fieldgroup',
28
-            action='store',
29
-            dest='nofg',
30
-            default = 10,
31
-            help='Chances for a class to have no fieldgroup',
32
-            type="int",
33
-            metavar="INT",
34
-        ),
35
-        make_option('--no-types',
36
-            action='store',
37
-            dest='notype',
38
-            default = 10,
39
-            help='Chances for a class to have no types',
40
-            type="int",
41
-            metavar="INT",
42
-        ),
43
-        make_option('--max-types',
44
-            action='store',
45
-            dest='ntype',
46
-            default = 8,
47
-            help='Maximum number of types in a class',
48
-            type="int",
49
-            metavar="INT",
50
-        ),
51
-        make_option('--sel-opt-field',
52
-            action='store',
53
-            dest='seltype',
54
-            default = 2,
55
-            help='Chances for type to select an optionnal field',
56
-            type="int",
57
-            metavar="INT",
58
-        ),
59
-        make_option('--superiors',
60
-            action='store',
61
-            dest='ntypesuperiors',
62
-            default = 2,
63
-            help='Chances for a type to link with other types (superiors)',
64
-            type="int",
65
-            metavar="INT",
66
-        ),
67
-        make_option('--no-fields',
68
-            action='store',
69
-            dest='nofields',
70
-            default = 10,
71
-            help='Chances for a fieldgroup to be empty',
72
-            type="int",
73
-            metavar="INT",
74
-        ),
75
-        make_option('--max-fields',
76
-            action='store',
77
-            dest='nfields',
78
-            default = 8,
79
-            help='Maxmimum number of fields per fieldgroup',
80
-            type="int",
81
-            metavar="INT",
82
-        ),
83
-        make_option('--rel-to-type-attr',
84
-            action='store',
85
-            dest='rfields',
86
-            default = 5,
87
-            help='Maximum number of relation-to-type attribute fields',
88
-            type="int",
89
-            metavar="INT",
90
-        ),
91
-        make_option('--opt-field',
92
-            action='store',
93
-            dest='optfield',
94
-            default = 2,
95
-            help='Chances for a field to be optionnal',
96
-            type="int",
97
-            metavar="INT",
98
-        ),
99
-        make_option('-o',
100
-            '--output',
101
-            action='store',
102
-            dest='output',
103
-            default = 'random_me.json',
104
-            help='json output file for the me',
105
-            type="string",
106
-            metavar="FILENAME",
107
-        ),
108
-        make_option('-d',
109
-            '--output-dot',
110
-            action='store',
111
-            dest='dotout',
112
-            default = False,
113
-            help='graphviz output file for the me',
114
-            type="string",
115
-            metavar="FILENAME",
116
-        ),
117
-
118
-
119
-    )
120
-    help = 'Randomly generate an EditorialModel'
121
-
122
-    def handle(self, *args, **options):
123
-        anames = ['classtype','nclass', 'nofg', 'notype', 'ntype', 'seltype', 'ntypesuperiors', 'nofields', 'nfields', 'optfield']
124
-        chances = dict()
125
-        for n in anames:
126
-            chances[n] = options[n]
127
-        
128
-        bj = EmBackendJson(options['output'])
129
-
130
-        em = RandomEm.random_em(EmBackendDummy())
131
-        bj.save(em)
132
-
133
-        if options['dotout']:
134
-            gvb = EmBackendGraphviz(options['dotout'])
135
-            gvb.save(em)
136
-
137
-

+ 0
- 24
Lodel/management/commands/listfieldtypes.py View File

@@ -1,24 +0,0 @@
1
-from django.core.management.base import BaseCommand, CommandError
2
-from optparse import make_option
3
-import EditorialModel
4
-
5
-class Command(BaseCommand):
6
-    option_list = BaseCommand.option_list + (
7
-        make_option('--silent',
8
-            action='store_true',
9
-            dest='silent',
10
-            default=False,
11
-            help='Only display field types name and hide the help text'),
12
-    )
13
-    help = 'List all the possible field types'
14
-
15
-    def handle(self, *args, **options):
16
-        ftl = EditorialModel.fields.EmField.fieldtypes_list()
17
-        ftl.sort()
18
-        if options['silent']:
19
-            for ftype in ftl:
20
-                self.stdout.write("%s\n"%ftype)
21
-        else:
22
-            self.stdout.write("Field types list : ")
23
-            for ftype in ftl:
24
-                self.stdout.write("\t{0:15} {1}".format(ftype, EditorialModel.fieldtypes.generic.GenericFieldType.from_name(ftype).help))

+ 0
- 14
Lodel/settings/__init__.py View File

@@ -1,14 +0,0 @@
1
-import os
2
-from Lodel.settings.defaults import *
3
-
4
-DEBUG = True
5
-
6
-if DEBUG:
7
-    from Lodel.settings.dev import *
8
-else:
9
-    from Lodel.settings.production import *
10
-
11
-try:
12
-    from Lodel.settings.locale import *
13
-except ImportError:
14
-        pass

+ 0
- 63
Lodel/settings/defaults.py View File

@@ -1,63 +0,0 @@
1
-DEBUG = True
2
-
3
-TEMPLATE_DEBUG = True
4
-
5
-LOGGING = {
6
-    'version': 1,
7
-    'disable_existing_loggers': False,
8
-    'formatters': {
9
-        'verbose': {
10
-            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s',
11
-        },
12
-        'simple': {
13
-            'format': '%(levelname)s %(module)s %(funcName)s %(message)s',
14
-        },
15
-    },
16
-    'handlers': {
17
-        'console': {
18
-            'class': 'logging.StreamHandler',
19
-            'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG'),
20
-            'formatter': 'simple',
21
-        },
22
-    },
23
-    'loggers': {
24
-        'django': {
25
-            'handlers': ['console'],
26
-            'propagate': True,
27
-            'level': 'DEBUG',
28
-        },
29
-        'Lodel2.database': {
30
-            'handlers': ['console'],
31
-            'level': 'DEBUG',
32
-            'propagate': True,
33
-        },
34
-        'EditorialModel' : {
35
-            'handlers': ['console'],
36
-            'propagate': True,
37
-            'level': 'DEBUG',
38
-        },
39
-    },
40
-}
41
-
42
-DATABASES = {
43
-    'default': {
44
-        'ENGINE': 'django.db.backends.mysql',
45
-        'NAME': 'lodel2',
46
-        'USER': 'lodel',
47
-        'PASSWORD': 'bruno',
48
-        'HOST': 'localhost',
49
-    }
50
-}
51
-
52
-# Internationalization
53
-
54
-LANGUAGE_CODE = 'en-us'
55
-
56
-TIME_ZONE = 'UTC'
57
-
58
-USE_I18N = True
59
-
60
-USE_L10N = True
61
-
62
-USE_TZ = True
63
-

+ 0
- 0
Lodel/settings/dev.py View File


+ 0
- 0
Lodel/settings/production.py View File


Loading…
Cancel
Save