Everyone on this site heard about problem preparing tool, maintained by MikeMirzayanov called polygon.
It have a lot of advantages, like automatic checks of everything you can imagine. But also, it have several very annoying things. The main one for me is necessity of synchronizing solutions and generators files by hand, between polygon and your local copy. So I had written a tool, which can do it.
Tool is published on github, with instructions how to install it. You are welcome with any new features/suggestions (I'm not knowing python very well, to be honest).
Known problems:
- Not tested good enough, probably buggy
- Installation script working strange. Anyone knowing python better? Any better ways to distribute?
- Sometimes lost of session is not detected and script fails with strange non-readable errors. relogin helps
- Parsing html pages can be not stable enough with changing polygon. Waiting for better api from MikeMirzayanov and codeforces team.
Thank you!
For me, it will be comfortable to put all the files in a single folder (without solutions/ and src/) + also process resources in the same way as files/solutions.
And
update
oninit
will be nice.It seems running
polygon-cli
in solutions/ directory causes an errorNo session known. Use relogin or init first.
Is any way to run something like
polygon-cli status
andpolygon-cli diff [file]
?Answering to all three at time.
About the installation: try adding your package to PyPI. That way the package may be installed (together with all dependencies) in a single command like
pip install polygon-cli
.Btw, what kind of failures do you see with
setup.py
? If it's on Windows, it may be UAC which may require elevation in order to create scripts inPython34\Scripts
I second this, that way
requirements.txt
will be created as well, which lists the packages your package depends on, so that you do not have to install them manually.What's with the "Installation script working strange" ? I think I can help.
For me, it works fine. But i had tested on several friends, before publishing here. Some of them had requirements not installed automatically. Some had errors on imports of local files while running. Second issue was probably fixed by changing
import xxx
tofrom . import xxx
, but i'm not sure it's good way.I have had that second issue before and I think that the only way to use custom libraries over a console script installation is using the '.' syntax. We can accept SystemError in case of absolute import failure to revert back to real import.
I will install your script and see how it works on my system.
This tool is amazing. Thank you so much.
I'm trying to use this tool, since I'd prefer it over the polygon webinterface. But I noticed that the problem statement does not get downloaded, and it seems that this is because it is not exposed by the polygon API. Am I correct? It would be great if that were possible!
As a side note: since polygon internally seems to use a version control system, why can't that be exposed as well, next to the API? Either read-only, or even better: read/write with commit-hooks checking that updates adhere to the internal data format of polygon.
При импорте из архива не добавляются баллы за тесты и зависимости групп (в xml они есть). Это не предусмотрено или я что-то делаю не так? Баллы есть при генерации тестов из скрипта, но его как раз нет, есть готовые тесты в архиве.