Permalink
Browse files

removing/commenting out print statements

  • Loading branch information...
1 parent a7cc37d commit 6a15dc689cd67d460515c3811c17493dfdde0be1 @evildmp committed Oct 31, 2011
View
14 arkestra_image_plugin/cms_plugins.py
@@ -32,9 +32,9 @@ def render(self, context, instance, placeholder):
"""
# TODO: this scaling code needs to be in a common place
# use the placeholder width as a hint for sizing
- print
- print "----------------- Image plugin ------------------------"
- print "image:", instance.image, "image width:", instance.image.width
+ # print
+ # print "----------------- Image plugin ------------------------"
+ # print "image:", instance.image, "image width:", instance.image.width
# get the image's aspect ratio, in case we need it later
aspect_ratio = float(instance.image.width)/instance.image.height
instance.has_borders = False
@@ -77,7 +77,7 @@ def render(self, context, instance, placeholder):
# shave off 5 point if the image is floated, to make room for a margin
# see arkestra.css, span.image.left and span.image.right
if instance.float:
- print "-5 for float"
+ # print "-5 for float"
width = width - 5
# if the instance has an aspect ratio, use that to calculate the height
@@ -97,7 +97,7 @@ def render(self, context, instance, placeholder):
else:
height = width / aspect_ratio
#else:
- # print "doing something funny"
+ # # print "doing something funny"
# height was not externally defined: use image's native ratio to scale it by the width
# height = int( float(width)*float(instance.image.height)/float(instance.image.width) )
@@ -106,8 +106,8 @@ def render(self, context, instance, placeholder):
instance.float = instance.float or "" # used as a CSS class
- print
- print "final output size", width, "x", height
+ # print
+ # print "final output size", width, "x", height
context.update({
'object':instance,
View
12 arkestra_utilities/plugin_modifiers.py
@@ -37,7 +37,7 @@ def modify(self, context, placeholder_width):
adjustment = float(context.get("width_adjustment", 0))
if adjust_width:
- print "need to adjust"
+ # print "need to adjust"
if adjuster == "divider":
placeholder_width = placeholder_width/adjustment
elif adjuster == "multiplier":
@@ -49,7 +49,7 @@ def modify(self, context, placeholder_width):
elif adjuster == "absolute":
placeholder_width = adjustment
placeholder_width = int(placeholder_width)
- print "adjusted placeholder width:", placeholder_width
+ # print "adjusted placeholder width:", placeholder_width
return placeholder_width
@@ -135,13 +135,13 @@ class ColumnWidths(WidthAdjuster):
}
def modify(self, context, element, width):
- print "============ ColumnWidths "
+ # print "============ ColumnWidths "
element_class = element.get("class", "") # and its HTML class
# if this is a column whose parent is a row
if re.search(r"\column\b", element_class) and "columns" in element.parent.get("class", ""):
# columns is the number of columns, or 1 if not specified
columns = float(element.parent.get("class", "").split("columns")[1][0] or 1)
- print " this is a column:", element_class
+ # print " this is a column:", element_class
# if double or triplewidth
if "triplecolumn" in element_class:
columnwidth = 3.0
@@ -161,15 +161,15 @@ def mark(self, context, element, markers):
no_image_border_class = context.get("no_image_border_class", "no-image-borders")
element_class = element.get("class", "") # and its HTML class
if image_border_class in element_class:
- print "has borders"
+ # print "has borders"
markers["has_borders"] = True
if no_image_border_class in element_class:
markers["has_borders"] = False
return markers
def modify(self, context, markers, width):
if markers.get("has_borders"):
- print "-16 for borders"
+ # print "-16 for borders"
width = width - context.get("image_border_reduction", 16)
return width
View
20 news_and_events/managers.py
@@ -24,20 +24,20 @@ def get_news_ordered_by_importance_and_date(self, instance):
Q(hosted_by=instance.entity) | Q(is_sticky_everywhere = True),
sticky_until__gte=datetime.today(),
)
- print "Sticky news", sticky_news.count()
- print "Non-sticky news", non_sticky_news.count()
+ # print "Sticky news", sticky_news.count()
+ # print "Non-sticky news", non_sticky_news.count()
top_news = list(sticky_news)
# now we have to go through the non-top items, and find any that can be promoted
# get the set of dates where possible promotable items can be found
dates = non_sticky_news.dates('date', 'day').reverse()
- print "Going through the date set"
+ # print "Going through the date set"
for date in dates:
- print " examining possibles from", date
+ # print " examining possibles from", date
# get all non-top items from this date
possible_top_news = non_sticky_news.filter(date__year=date.year, date__month= date.month, date__day= date.day)
# promotable items have importance > 0
- print " found", possible_top_news.count(), "of which I will promote", possible_top_news.filter(Q(hosted_by=instance.entity) | Q(is_sticky_everywhere = True),importance__gte = 1).count()
+ # print " found", possible_top_news.count(), "of which I will promote", possible_top_news.filter(Q(hosted_by=instance.entity) | Q(is_sticky_everywhere = True),importance__gte = 1).count()
# add the good ones to the top news list
top_news.extend(possible_top_news.filter(
Q(hosted_by=instance.entity) | Q(is_sticky_everywhere = True),
@@ -51,20 +51,20 @@ def get_news_ordered_by_importance_and_date(self, instance):
if demotable_items.count() > 0:
# put those unimportant items into ordinary news
ordinary_news.extend(demotable_items)
- print " demoting", demotable_items.count()
+ # print " demoting", demotable_items.count()
# and stop looking for any more
break
# and add everything left in non-sticky news before this date
if dates:
remaining_items = non_sticky_news.filter(date__lte=date)
- print " demoting the remaining", remaining_items.count()
+ # print " demoting the remaining", remaining_items.count()
ordinary_news.extend(remaining_items)
for item in top_news:
item.sticky = True
if instance.format == "title":
item.importance = None
- print "Top news", len(top_news)
- print "Ordinary news", len(ordinary_news)
+ # print "Top news", len(top_news)
+ # print "Ordinary news", len(ordinary_news)
ordinary_news.sort(key=operator.attrgetter('date'), reverse = True)
return top_news, ordinary_news
@@ -85,7 +85,7 @@ def get_all_news(self, instance):
).distinct()
else:
all_news = self.model.objects.all()
- print "All news", all_news.count()
+ # print "All news", all_news.count()
return all_news
def get_items(self, instance):
View
25 news_and_events/models.py
@@ -157,12 +157,12 @@ def informative_url(self):
"""
An event has an 'informative_url' if it itself is uninformative, but it is a child of a series
"""
- print self, "checking"
+ # print self, "checking"
if self.is_uninformative and self.parent and self.parent.series:
- print self, "parent!"
+ # print self, "parent!"
return self.parent.get_absolute_url()
else:
- print self, "self!"
+ # print self, "self!"
return self.get_absolute_url()
@property
@@ -175,17 +175,8 @@ def show_parent_series(self):
@property
def is_uninformative(self):
- print "+++"
- print 1, "checking is_uninformativeness"
- print 2, type(self.body)
- print 3, type(self.body.cmsplugin_set.all())
- print 4, self.external_url
- print 5, self.please_contact.all()
- print 6, self.registration_enquiries.all()
- print 7, self.links
- print "---"
if self.body and self.body.cmsplugin_set.all() or self.external_url or self.please_contact.all() or self.registration_enquiries.all() or self.links:
- print "uninformative"
+ # print "uninformative"
return False
else:
return "informative"
@@ -202,20 +193,20 @@ def slug_is_bad(self):
suffix = slugify(date(self.start_date, "Y"))
if not suffix in self.slug:
self.slug = self.slug + "-" + suffix
- print "adding suffix:", suffix, self.slug
+ # print "adding suffix:", suffix, self.slug
if slug_is_bad(self):
suffix = slugify(date(self.start_date, "F"))
if not suffix in self.slug:
self.slug = self.slug + "-" + suffix
- print "adding suffix:", suffix, self.slug
+ # print "adding suffix:", suffix, self.slug
if slug_is_bad(self):
suffix = slugify(date(self.start_date, "d"))
if not suffix in self.slug:
self.slug = self.slug + "-" + suffix
- print "adding suffix:", suffix, self.slug
+ # print "adding suffix:", suffix, self.slug
while slug_is_bad(self):
self.slug=self.slug + "-x"
- print "adding suffix:", "-x"
+ # print "adding suffix:", "-x"
super(Event, self).save()
def get_children_forthcoming(self):
View
2 vacancies_and_studentships/cms_plugins.py
@@ -13,8 +13,6 @@
from models import VacanciesPlugin, Vacancy, Studentship
from mixins import VacancyStudentshipPluginMixin
-# for tabbed interface
-
class VacanciesStudentshipsPluginForm(UniversalPluginForm, forms.ModelForm):
class Meta:
model = VacanciesPlugin
View
10 vacancies_and_studentships/managers.py
@@ -13,7 +13,7 @@ def get_items(self, instance):
"""
returns current_studentships, archived_studentships, series_studentships
"""
- print "____ get_studentships() ____"
+ # print "____ get_studentships() ____"
if instance.type == "for_person":
all_studentships = instance.person.studentship_featuring.all()
elif instance.type == "for_place":
@@ -28,20 +28,20 @@ def get_items(self, instance):
# if an entity should automatically publish its descendants' items
# all_studentships = Event.objects.filter(Q(hosted_by__in=instance.entity.get_descendants(include_self=True)) | Q(publish_to=instance.entity)).distinct().order_by('start_date')
- print "All studentships", instance.type, all_studentships.count()
+ # print "All studentships", instance.type, all_studentships.count()
instance.current_studentships = all_studentships.filter(closing_date__gte = datetime.now())
instance.archived_studentships = all_studentships.exclude(closing_date__gte = datetime.now())
- print "Previous studentships", instance.archived_studentships.count()
+ # print "Previous studentships", instance.archived_studentships.count()
return self.model.objects.all()
class VacancyManager(UniversalPluginModelManagerMixin):
def get_items(self, instance):
"""
"""
- print "____ get_vacancies() ____"
+ # print "____ get_vacancies() ____"
if instance.type == "for_person":
all_vacancies = instance.person.vacancy_featuring.all()
# most likely, we're getting vacancies related to an entity
@@ -54,7 +54,7 @@ def get_items(self, instance):
# if an entity should automatically publish its descendants' items
# all_vacancies = Event.objects.filter(Q(hosted_by__in=instance.entity.get_descendants(include_self=True)) | Q(publish_to=instance.entity)).distinct().order_by('start_date')
- print "All vacancies", all_vacancies.count()
+ # print "All vacancies", all_vacancies.count()
instance.current_vacancies = all_vacancies.filter(closing_date__gte = datetime.now())
instance.archived_vacancies = all_vacancies.exclude(closing_date__gte = datetime.now())
View
2 vacancies_and_studentships/templatetags/vacancies_and_studentships_tags.py
@@ -130,7 +130,7 @@ def gather_studentships(entity):
Q(also_advertise_on__in=entity.get_descendants(include_self=True))
)
"""for item in studentshiplist:
- print item
+ # print item
studentshiplist = set()
for entity in entity.get_descendants(include_self = True):

0 comments on commit 6a15dc6

Please sign in to comment.