Browse Source

remove inused print

master
tr4ck3ur des JM2L 9 years ago
parent
commit
e3d6c9839f
6 changed files with 11 additions and 21 deletions
  1. +5
    -2
      development.ini
  2. +0
    -1
      jm2l/models.py
  3. +2
    -11
      jm2l/upload.py
  4. +1
    -6
      jm2l/views.py
  5. +2
    -0
      production.ini
  6. +1
    -1
      wsgi.py

+ 5
- 2
development.ini View File

@@ -6,7 +6,8 @@
[app:main] [app:main]
use = egg:JM2L use = egg:JM2L


pyramid.reload_templates = true
pyramid.reload_templates = false
#true
pyramid.debug_authorization = false pyramid.debug_authorization = false
pyramid.debug_notfound = false pyramid.debug_notfound = false
pyramid.debug_routematch = false pyramid.debug_routematch = false
@@ -14,6 +15,8 @@ pyramid.default_locale_name = en
pyramid.includes = pyramid.includes =
pyramid_debugtoolbar pyramid_debugtoolbar
pyramid_tm pyramid_tm
pyramid_mako
pyramid_exclog


sqlalchemy.url = sqlite:///%(here)s/JM2L.sqlite sqlalchemy.url = sqlite:///%(here)s/JM2L.sqlite


@@ -64,7 +67,7 @@ qualname = sqlalchemy.engine
[handler_console] [handler_console]
class = StreamHandler class = StreamHandler
args = (sys.stderr,) args = (sys.stderr,)
level = NOTSET
level = DEBUG
formatter = generic formatter = generic


[formatter_generic] [formatter_generic]


+ 0
- 1
jm2l/models.py View File

@@ -153,7 +153,6 @@ class User(Base):
@classmethod @classmethod
def by_hash(cls, tsthash): def by_hash(cls, tsthash):
for u in DBSession.query(cls): for u in DBSession.query(cls):
print u.nom, u.my_hash
if u.my_hash==tsthash: if u.my_hash==tsthash:
return u return u
return None return None


+ 2
- 11
jm2l/upload.py View File

@@ -48,11 +48,9 @@ class MediaPath():
def get_list(self, media_table, linked_id): def get_list(self, media_table, linked_id):
filelist = list() filelist = list()
curpath = self.get_mediapath(media_table, linked_id, None) curpath = self.get_mediapath(media_table, linked_id, None)
print curpath
if not os.path.isdir(curpath): if not os.path.isdir(curpath):
return list() return list()
for f in os.listdir(curpath): for f in os.listdir(curpath):
print curpath
if os.path.isdir(os.path.join(curpath,f)): if os.path.isdir(os.path.join(curpath,f)):
continue continue
if f.endswith('.type'): if f.endswith('.type'):
@@ -69,7 +67,6 @@ class MediaPath():
if not os.path.isdir(curpath): if not os.path.isdir(curpath):
return list() return list()
for f in os.listdir(curpath): for f in os.listdir(curpath):
print curpath
if os.path.isdir(os.path.join(curpath,f)): if os.path.isdir(os.path.join(curpath,f)):
continue continue
if f.endswith('.type'): if f.endswith('.type'):
@@ -154,9 +151,7 @@ class MediaUpload(MediaPath):
result['error'] = 'Ce type fichier n\'est malheureusement pas supporté. ' result['error'] = 'Ce type fichier n\'est malheureusement pas supporté. '
result['error'] += 'Les fichiers acceptées sont les images et pdf.' result['error'] += 'Les fichiers acceptées sont les images et pdf.'
return False return False
print result['size']
if result['size'] < MIN_FILE_SIZE: if result['size'] < MIN_FILE_SIZE:
raise
result['error'] = 'le fichier est trop petit' result['error'] = 'le fichier est trop petit'
elif result['size'] > MAX_FILE_SIZE: elif result['size'] > MAX_FILE_SIZE:
result['error'] = 'le fichier est trop voluminueux' result['error'] = 'le fichier est trop voluminueux'
@@ -254,7 +249,6 @@ class MediaUpload(MediaPath):
def fileinfo(self,name): def fileinfo(self,name):
filename = self.mediapath(name) filename = self.mediapath(name)
f, ext = os.path.splitext(name) f, ext = os.path.splitext(name)
print "fileinfo ? '%s'" % name, filename
if ext!='.type' and os.path.isfile(filename): if ext!='.type' and os.path.isfile(filename):
info = {} info = {}
info['name'] = name info['name'] = name
@@ -318,21 +312,18 @@ class MediaUpload(MediaPath):
except IOError: except IOError:
pass pass
except OSError: except OSError:
print self.mediapath(filename) + '.type', 'Not found'
pass pass
try: try:
os.remove(self.thumbnailpath(filename)) os.remove(self.thumbnailpath(filename))
except IOError: except IOError:
pass pass
except OSError:
print self.thumbnailpath(filename), 'Not found'
except OSError:
pass pass
try: try:
os.remove(self.thumbnailpath(filename+".jpg")) os.remove(self.thumbnailpath(filename+".jpg"))
except IOError: except IOError:
pass pass
except OSError:
print self.thumbnailpath(filename), 'Not found'
except OSError:
pass pass
try: try:
os.remove(self.mediapath(filename)) os.remove(self.mediapath(filename))


+ 1
- 6
jm2l/views.py View File

@@ -477,8 +477,6 @@ def Modal(request):
request=request) request=request)
response.content_type = 'text/javascript' response.content_type = 'text/javascript'
return response return response
else:
print form.errors
if modtype in ['AskC', 'AskH', 'AskM', 'PropC', 'PropH', 'PropM']: if modtype in ['AskC', 'AskH', 'AskM', 'PropC', 'PropH', 'PropM']:
if uid>0: if uid>0:
Exch = Exchange.by_id(uid) Exch = Exchange.by_id(uid)
@@ -553,10 +551,7 @@ def Modal(request):
created_by=1 created_by=1
) )
DBSession.add(Itinerary) DBSession.add(Itinerary)
DBSession.flush()
print form.start_place.data
print form.arrival_place.data
print form.itin_id.data
DBSession.flush()
Exch.itin_id = Itinerary.itin_id Exch.itin_id = Itinerary.itin_id
# Start Time # Start Time
StartEvent = DBSession.query(JM2L_Year.start_time).filter(JM2L_Year.year_uid==year).first() StartEvent = DBSession.query(JM2L_Year.start_time).filter(JM2L_Year.year_uid==year).first()


+ 2
- 0
production.ini View File

@@ -13,6 +13,8 @@ pyramid.debug_routematch = false
pyramid.default_locale_name = fr pyramid.default_locale_name = fr
pyramid.includes = pyramid.includes =
pyramid_tm pyramid_tm
pyramid_mako
pyramid_exclog


sqlalchemy.url = sqlite:///%(here)s/JM2L.sqlite sqlalchemy.url = sqlite:///%(here)s/JM2L.sqlite




+ 1
- 1
wsgi.py View File

@@ -1,4 +1,4 @@
APP_CONFIG = "production.ini"
APP_CONFIG = "prod.ini"


#Setup logging #Setup logging
import logging.config import logging.config


Loading…
Cancel
Save