Skip to content

Commit

Permalink
itervalues -> values; iteritems -> items
Browse files Browse the repository at this point in the history
  • Loading branch information
znick committed Dec 6, 2023
1 parent 04947d5 commit 2e1b1e0
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion anytask/anycontest/management/commands/check_contest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def handle(self, **options):
except Exception as e:
logger.exception(e)

# for contest_id, students_info in contest_marks.iteritems():
# for contest_id, students_info in contest_marks.items():
# set_contest_marks(contest_id, students_info)

# logging to cron log
Expand Down
4 changes: 2 additions & 2 deletions anytask/courses/templates/courses/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ <h5 class="card-title">{% trans "jakontest" %}</h5>
<div class="form-group row" style="display: none;" >
<div class="controls col-lg-8 col-md-12">
<select name="tasks_with_contest_rejudge[]" id="tasks_with_contest_rejudge_select" class="form-control" multiple="multiple">
{% for contest_id, tasks in tasks_with_contest.iteritems %}
{% for contest_id, tasks in tasks_with_contest.items %}
<optgroup label="{{ contest_id }}">
{% for task in tasks %}
<option value="{{ task.id }}" selected>{% get_text_from_json task 'get_title' LANGUAGE_CODE %}</option>
Expand All @@ -261,7 +261,7 @@ <h5 class="card-title">{% trans "jakontest" %}</h5>
<div class="form-group row" style="display: none;" >
<div class="controls col-lg-8 col-md-12">
<select name="tasks_with_contest[]" id="tasks_with_contest_select" class="form-control" multiple="multiple">
{% for contest_id, tasks in tasks_with_contest.iteritems %}
{% for contest_id, tasks in tasks_with_contest.items %}
<optgroup label="{{ contest_id }}">
{% for task in tasks %}
<option value="{{ task.id }}" selected>{% get_text_from_json task 'get_title' LANGUAGE_CODE %}</option>
Expand Down
2 changes: 1 addition & 1 deletion anytask/courses/templates/courses/tasklist/shad_cpp.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h4 class="modal-title" id="modal_table_edit_header">{% trans "itogovaja_tablica
</div>
<div class="modal-body">
<p>{% trans "izmenenie_udalenie_zadach" %}</p>
{% for group, tasks in group_tasks.iteritems %}
{% for group, tasks in group_tasks.items %}
<div id="group_sort_{{ group.id }}" data-group="{{ group.id }}" data-table="#table_results_{{ group.id }}" data-marksystem="{% if course_mark_system_vals %}true{% endif %}" class="collapse">
<p class="modal-group-name">{{ group.name }}</p>
<ul class="group-sortable" name="group_sort_{{ group.id }}">
Expand Down
2 changes: 1 addition & 1 deletion anytask/issues/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def issue_page(request, issue_id):
'comment': value,
'files': request.FILES.getlist('files')
}
if 'need_info' in request.POST and any(value.itervalues()):
if 'need_info' in request.POST and any(value.values()):
issue.set_status_need_info()

issue.set_field(field, value, request.user)
Expand Down
2 changes: 1 addition & 1 deletion anytask/mail/templates/mail.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ <h4 class="modal-title">{% trans "dobavit_gruppu_polzovatelej" %}</h4>
</div>
<div class="tab-pane fade" id="statuses" role="tabpanel">
<select id="modal_add_status_select" multiple>
{% for status_type, status_values in user_statuses.iteritems %}
{% for status_type, status_values in user_statuses.items %}
<optgroup data-not_selectable="1" label="{% if status_type %}{{ status_values.type_name }}{% else %}{% trans "bez_tipa" %}{% endif %}">
{% for status_info in status_values.values %}
<option value="{{ status_info.id }}" data-id="{{ status_info.id }}" data-type="status">{{ status_info.name }}</option>
Expand Down
6 changes: 3 additions & 3 deletions anytask/staff/templates/staff.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h5 class="card-title">{% trans "polzovateli" %}</h5>
</tr>
</thead>
<tbody>
{% for id_user, user_info in filter.users_info.iteritems %}
{% for id_user, user_info in filter.users_info.items %}
<tr data-id_user="{{ id_user }}" data-id_profile="{{ user_info.id_profile }}">
<td>
<input type='checkbox' class='table-checkbox'>
Expand All @@ -101,7 +101,7 @@ <h5 class="card-title">{% trans "polzovateli" %}</h5>
</td>
<td title="{{ user_info.email }}">{{ user_info.email }}</td>
<td>
{% for id_status, status_info in user_info.statuses.iteritems %}
{% for id_status, status_info in user_info.statuses.items %}
<span class="label" title="{{ status_info.name }}" style="background-color: {{ status_info.color }}">{{ status_info.name }}</span>
{% endfor %}
</td>
Expand Down Expand Up @@ -134,7 +134,7 @@ <h4 class="modal-title">{% trans "redaktirovanie_statusov" %}</h4>
<p>{% trans "vybrano_polzovateley" %}&nbsp;<span class="selected_users_count"></span>.</p>
<form id="form_change_status">
{% csrf_token %}
{% for status_type, status_values in statuses.iteritems %}
{% for status_type, status_values in statuses.items %}
<fieldset class="form-group">
<label class="status-type-label" data-type="{{ status_type }}">
{% if status_type %}
Expand Down
4 changes: 2 additions & 2 deletions anytask/tasks/templates/email_notification_task.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</p>
</td>
</tr>
{% for key_course, tasks_info in courses_info.iteritems %}
{% for key_course, tasks_info in courses_info.items %}
{% if key_course != 'user' %}
<tr>
<td>
Expand All @@ -26,7 +26,7 @@
>"{{ course.name }}"</a>
{% trans "proizoshli_izmeneniya" %}:
<ul style="margin:0;text-align: justify">
{% for key_task, task_info in tasks_info.iteritems %}
{% for key_task, task_info in tasks_info.items %}
{% if key_task != 'course' %}
<li>
{% if task_info.1 %}
Expand Down
4 changes: 2 additions & 2 deletions anytask/tasks/templates/email_notification_task.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load i18n %}{% load dict_func %}{% load info %}
{% trans "zdravstvujte" %}, {{ user.get_full_name }}!
{% for key_course, tasks_info in courses_info.iteritems %}{% if key_course != 'user' %}{% with course=tasks_info|key:"course" %}
{% trans "v_kurse" %} "{{ course.name }}" {% trans "proizoshli_izmeneniya" %}:{% for key_task, task_info in tasks_info.iteritems %}{% if key_task != 'course' %}
{% for key_course, tasks_info in courses_info.items %}{% if key_course != 'user' %}{% with course=tasks_info|key:"course" %}
{% trans "v_kurse" %} "{{ course.name }}" {% trans "proizoshli_izmeneniya" %}:{% for key_task, task_info in tasks_info.items %}{% if key_task != 'course' %}
- {% if task_info.1 %}{% trans 'dobavlena_zadacha' %} "{% get_text_from_json task_info.0 'get_title' LANGUAGE_CODE %}"{% else %}{% filter lower %}{% trans 'v_zadache' %}{% endfilter %} "{% get_text_from_json task_info.0 'get_title' LANGUAGE_CODE %}" {% trans 'izmenilis' %}: {{ task_info|slice:"2:"|join:", " }}{% endif %}{% endif %}{% endfor %}
{% trans 'pereyti_v_kurs' %}: {{ domain }}{{ course.get_absolute_url }}{% endwith %}
{% endif %}{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion anytask/users/templates/user_courses.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h5 class="card-title">
{% for year, courses_in_year in table %}
<div class="tab-pane fade {% if year == current_year or forloop.last and not table|has_item:current_year %}in active{% endif %}" id="{% if forloop.parentloop.first %}courses_{% else %}courses_archive_{% endif %}{{ forloop.counter }}" role="tabpanel">
<div class="card-block">
{% for table_id, course_statistics in courses_in_year.iteritems %}
{% for table_id, course_statistics in courses_in_year.items %}
<div class="card-table">
<table class="table table_courses">
<thead>
Expand Down
2 changes: 1 addition & 1 deletion deploy_local_beta/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
export ANYBETA_ROOT=$PWD
export ANYBETA_DEPLOY="$PWD/deploy_local_beta"

export ANYBETA_PYTHON_PATH="`which python3`"
export ANYBETA_PYTHON_PATH="/Users/zhnick/.pyenv/versions/3.8.18/bin/python3"

export ANYBETA_VENV_NAME="anytask_venv"
export ANYBETA_VENV_DIR="$ANYBETA_ROOT/$ANYBETA_VENV_NAME"
Expand Down
4 changes: 2 additions & 2 deletions easyci/easy_ci_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ def main():
pool = Pool(processes=PROCS)

logging.info("Queue:")
for qtask in queue.itervalues():
for qtask in queue.values():
logging.info("%s\t%s\t%s\t%s\t%s\t%s", qtask.host, qtask.course["course_id"], qtask.id, qtask.task["title"],
qtask.issue["student"]["username"], "{}/issue/{}".format(qtask.host, qtask.issue["id"]))
if "--only_queue" in sys.argv:
sys.exit(0)

for qtask in pool.imap_unordered(proccess_task, queue.itervalues()):
for qtask in pool.imap_unordered(proccess_task, queue.values()):
logging.info(" == Parralel Task %d DONE!, URL: %s/issue/%d", qtask.id, qtask.host, qtask.issue["id"])

logging.info("All DONE!")
Expand Down

0 comments on commit 2e1b1e0

Please sign in to comment.