Skip to content

Commit 9eac665

Browse files
committed
Cleanup
1 parent ea6e2f5 commit 9eac665

File tree

4 files changed

+4
-39
lines changed

4 files changed

+4
-39
lines changed

devtools/gearbox/quickstart/command.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import re
44
import os
55
import shutil
6-
import sys
76
import glob
87
import importlib.metadata
98
import importlib.util
@@ -12,8 +11,6 @@
1211
from gearbox.template import GearBoxTemplate
1312
from gearbox.command import Command
1413

15-
PY3 = sys.version_info[0] == 3
16-
PYVERSION = sys.version_info[:2]
1714
beginning_letter = re.compile(r"^[^a-z]*")
1815
valid_only = re.compile(r"[^a-z0-9_]")
1916

@@ -37,15 +34,6 @@ def pre(self, command, output_dir, vars):
3734
elif vars['kajiki']:
3835
vars['template_engine'] = 'kajiki'
3936

40-
template_engine = vars.setdefault('template_engine', 'kajiki')
41-
42-
if template_engine == 'mako':
43-
# Support a Babel extractor default for Mako
44-
vars['babel_templates_extractor'] = ("('templates/**.mako',"
45-
" 'mako', None),\n%s#%s") % (' ' * 4, ' ' * 8)
46-
else:
47-
vars['babel_templates_extractor'] = ''
48-
4937
if vars['migrations'] == 'True':
5038
vars['egg_plugins'].append('tg.devtools')
5139

@@ -193,19 +181,10 @@ def take_action(self, opts):
193181
# if value is True:
194182
# template_vars[key] = 'True'
195183

196-
template_vars['PY3'] = PY3
197-
template_vars['PYVERSION'] = PYVERSION
198184
QuickstartTemplate().run(os.path.join(quickstart_path, 'template'),
199185
opts.name, template_vars)
200186

201187
os.chdir(opts.name)
202-
203-
try:
204-
sys.argv = ['setup.py', 'egg_info']
205-
imp.load_module('setup', *imp.find_module('setup', ['.']))
206-
except:
207-
print('Unable to run egg_info for newly created package! Continuing anyway...')
208-
209188
print("")
210189

211190
# dirty hack to allow "empty" dirs

devtools/gearbox/quickstart/template/+package+/config/app_cfg.py_tmpl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,13 @@ rendering_config['jinja_extensions'] = []
4141
{{endif}}
4242
{{if kajiki}}
4343
rendering_config['renderers'].append('kajiki')
44-
# Change this in setup.py too for i18n to work.
44+
# Change this in pyproject.toml too for i18n to work.
4545
rendering_config['templating.kajiki.strip_text'] = False
4646
{{endif}}
4747
{{if genshi}}
4848
rendering_config['renderers'].append('genshi')
49-
{{if PYVERSION >= (3, 4)}}
5049
rendering_config['templating.genshi.name_constant_patch'] = True
5150
{{endif}}
52-
{{endif}}
5351
base_config.update_blueprint(rendering_config)
5452

5553
# Configure Sessions, store data as JSON to avoid pickle security issues

devtools/gearbox/quickstart/template/+package+/model/auth.py_tmpl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,6 @@ class User(DeclarativeBase):
135135
hash = hash.hexdigest()
136136

137137
password = salt + hash
138-
139-
{{if PY3 == False}}
140-
# Make sure the hashed password is a unicode object at the end of the
141-
# process because SQLAlchemy _wants_ unicode objects for Unicode cols
142-
password = password.decode('utf-8')
143-
{{endif}}
144-
145138
return password
146139

147140
def _set_password(self, password):
@@ -264,13 +257,6 @@ class User(MappedClass):
264257
hash = hash.hexdigest()
265258

266259
password = salt + hash
267-
268-
{{if PY3 == False}}
269-
# Make sure the hashed password is a unicode object at the end of the
270-
# process because SQLAlchemy _wants_ unicode objects for Unicode cols
271-
password = password.decode('utf-8')
272-
{{endif}}
273-
274260
return password
275261

276262
def __set__(self, instance, value):

devtools/gearbox/quickstart/template/setup.cfg_tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Babel configuration
1+
# Babel configuration,
2+
# currently this are only supporterd in babel.cfg or setup.cfg
3+
24
[compile_catalog]
35
domain = {{package}}
46
directory = {{package}}/i18n

0 commit comments

Comments
 (0)