Skip to content

Commit

Permalink
Merge branch 'master' into update_to_python_3
Browse files Browse the repository at this point in the history
  • Loading branch information
znick committed Dec 8, 2023
2 parents 0b563c8 + 9460698 commit d5ea748
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 31 deletions.
18 changes: 0 additions & 18 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,3 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 10
ignore:
- dependency-name: ipython[notebook]
versions:
- 7.19.0
- 7.20.0
- 7.21.0
- dependency-name: lxml
versions:
- 4.6.2
- dependency-name: pytz
versions:
- "2020.5"
- dependency-name: jupyter-core
versions:
- 4.7.0
- dependency-name: jinja2
versions:
- 2.11.2
14 changes: 6 additions & 8 deletions anytask/anyrb/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def upload_review_unsafe(self):

with unpack_files(self.event.file_set.all()) as files:
for f in files:
mime_type = magic.from_buffer(f.file.read(1024), mime=True)
mime_type = magic.from_buffer(f.file.read(2048), mime=True)
if mime_type[:4] != 'text':
continue

Expand All @@ -54,22 +54,20 @@ def upload_review_unsafe(self):

from difflib import unified_diff
fname = f.filename()
from_name = u'a/{0}'.format(fname)
to_name = u'b/{0}'.format(fname)
from_name = 'a/{0}'.format(fname)
to_name = 'b/{0}'.format(fname)

diff = [(u'diff --git {0} {1}'.format(from_name, to_name))]
from_name = u'/dev/null'

diff_content = unified_diff('',
file_content,
fromfile=from_name,
tofile=to_name.encode('utf-8'))
tofile=to_name)

for line in diff_content:
line = line.strip()
if isinstance(line, str):
diff.append(line.decode('utf-8'))
else:
diff.append(line)
diff.append(line)

files_diff.append(u'\n'.join(diff))

Expand Down
2 changes: 1 addition & 1 deletion anytask/anyrb/unpacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, path, filename):

@property
def file(self):
return open(self.path)
return open(self.path, 'rb')

def filename(self):
return self._filename
Expand Down
2 changes: 1 addition & 1 deletion anytask/courses/templatetags/dict_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def get_url(d, key):

@register.filter(name='get_group_name')
def get_group_name(d):
return d.keys()[0].name
return list(d.keys())[0].name
2 changes: 1 addition & 1 deletion anytask/settings_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
LANGUAGES = (('ru', u'Русский'),
('en', 'English'))

FILE_UPLOAD_PERMISSIONS = 644 # 0644
# FILE_UPLOAD_PERMISSIONS = 644 # 0644


AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID')
Expand Down
4 changes: 2 additions & 2 deletions easyci2/flask/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ appdirs==1.4.3
attrs==20.3.0
CacheControl==0.12.6
cachelib==0.1.1
certifi==2019.11.28
certifi==2023.7.22
chardet==3.0.4
click==7.1.2
colorama==0.4.3
Expand Down Expand Up @@ -36,7 +36,7 @@ responses==0.13.2
retrying==1.3.3
six==1.14.0
toml==0.10.2
urllib3==1.26.5
urllib3==1.26.18
webencodings==0.5.1
Werkzeug==1.0.1
cachetools==4.2.4

0 comments on commit d5ea748

Please sign in to comment.