-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing return statement on class def closure.
- Loading branch information
Andrey Antukh
committed
Dec 18, 2013
1 parent
14b320b
commit 26e9d5f
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import _global as g | ||
|
||
def backlog_controller(scope, root_scope, route_params, rs, data, i18next): | ||
root_scope.page_title = i18next.t("common.baclog") | ||
root_scope.page_section = "backlog" | ||
root_scope.page_breadcrumbs = [["", ""],[i18next.t("common.backlog"), None]] | ||
root_scope.project_id = parseInt(root_scope.pid, 10) | ||
|
||
scope.stats = {} | ||
|
||
def on_project_stats_loaded(): | ||
if scope.project_stats.total_points > 0: | ||
scope.percentage_closed_points = ((scope.project_stats.closed_points * 100) / | ||
scope.project_stats.total_points) | ||
else: | ||
scope.percentage_closed_points = 0 | ||
|
||
def on_milestone_loaded(ctx, _data): | ||
if _data.length > 0: | ||
root_scope.sprint_id = _data[0].id | ||
|
||
on_fn = scope["$on"] | ||
emit_fn = scope["$emit"] | ||
|
||
on_fn("stats:update", lambda: data.load_project_stats(scope).then(on_project_stats_loaded)) | ||
on_fn("milestones:loaded", lambda: on_project_stats_loaded()) | ||
|
||
def on_project_load(): | ||
emit_fn("stats:update") | ||
data.loade_users_and_roles(scope) | ||
|
||
promise = data.load_project(scope) | ||
promise.then(on_project_load) | ||
|
||
class MyObject: | ||
def sample_method(): | ||
return 2 |