Vlad_Protosevich_protosevich2001@gmail.com#9
Conversation
|
Here is feedback about your script work:
This way you could awoid potential mistakes in the future convertations to other formats.
upd: please be sure to use labels in the future. Check slack for more info. |
|
Iteration 3 |
|
I am getting |
Also please respond in comments what of these points did you fix. |
--version - fixed |
|
Here is some feedback on your application: 1 (optional). It would be great to add some more logging to printong functions.
Please address existing issues |
Sometimes there are empty lines in the image url list: Please ensure that your app works with RSS feed urls other than yahoo. Also please describe the issues you fixed either in the commit message or in the comments here |
|
The problem is the symbol |
The issue disappeared |
|
Iteration 5. Colorize should work in pdf and html? |
| raise RssReaderException.RssReaderException('How work with application?\nEnter in command line: rss-reader -h') | ||
|
|
||
| if args.version: | ||
| result = f'RSS reader version {__init__.VERSION}' |
There was a problem hiding this comment.
It's not a good practive to use init file like that. You can define it here, in this module or make a file VERSION.txt, for example, that will contain the version of your application
| try: | ||
| data = feedparser.parse(url) | ||
| try: | ||
| if data.status == 200: |
There was a problem hiding this comment.
It is better to avoid using status for checking if we received feed or not.
data here has type FeedParserDict, which is inherited from dict, so it is a dictionary, which has keys and values.
Neither FeedParserDict nor dict have attribute status, so theoretically you should always get an AttributeError here.
BUT FeedParserDict class has its magic method __getattribute__ redefined (note: getattribute is called every time you try to access some object attribute using .) in a way so if there is no such attribute (for example status), it will try to look in this dictionary keys, using __getitem__ (note: getitem is called when you try to acccess some item in collection by key or by index: data["status"]). So there is no attribute status, but status is a key in data dictionary, so it is still luckily works.
In short, using status here is pretty volatile and may break your program, as you can see in one of your tests.
Moreover if you use bozo here you will be able to further simplify this function
| logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%I:%M:%S %p', | ||
| stream=sys.stdout, level=logging.DEBUG) | ||
| else: | ||
| logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%I:%M:%S %p', | ||
| filename="sample.log", level=logging.DEBUG) |
There was a problem hiding this comment.
These two logging line are almost the same, the only difference is in 1 keyword argument. It is better to use separate functions in these situations, but it is not mandatory here.
| if args.version: | ||
| result = f'RSS reader version {open("VERSION.txt").readline()}' |
There was a problem hiding this comment.
It would be better if you put it instead of pass before
| include rss_reader\TimesNewRoman.ttf | ||
| include rss_reader\VERSION.txt No newline at end of file |
There was a problem hiding this comment.
Because Linux and Windows have different filesystem separators, your setup installation will not work on Linux.
|
Here is feedback on your app: One test does not work: The code is clean, easy to read, well structured and mostly corresponds to the PEP8 style recommendations. Documentation is a bit lacking, it would be nice if you could put smaller examples here and focus more on describing your project, for example how to install it and etc. Commit messages mostly correspond to the recommended commit guidelines, but lacking in information. |



Iteration 3
Add README and bug fixes