nitdgpos / uip Goto Github PK
View Code? Open in Web Editor NEWA library, to customize your desktop wallpapers.
Home Page: https://nitdgpos.github.io/projects/UIP
License: GNU Affero General Public License v3.0
A library, to customize your desktop wallpapers.
Home Page: https://nitdgpos.github.io/projects/UIP
License: GNU Affero General Public License v3.0
for Windows we need py2exe and we'll add that our repo seperately after each release
TSIA
So right now pressing ctrl - c during execution gives a very ugly traceback: This should be avoided.
hint : put call to scheduler in UIP.py in a try except block with KeynoardInterrupt
as exception then use sys.exit(0)
sadly none of our developers have a mac yet, so its impossble for us to test this right now :(
in UIP.py print
Hey this is UIP! you can use it to download images from reddit
and also to schedule the setting of these images as your desktop wallpaper
let's use the structure:
UIP
|
\uiplib\
|
\setWallpaper.py
\scheduler.py
\scrape.py
\constants.py
\tests\
|
\(empty for now or we can have place holder files)
|
|.gitignore
|requirement files
|Readme
|Contributing
|UIP.py
i think UIP should be able to extract images of a considerable resolution from any website
Generally all imports are to be declared at the top of the file unless due to a certain reason you should not.
We need a CI system to continously integrate, and maybe rultor for a constant merge?
print Exiting UIP hope you had a nice time :)
before system exit in UIP.py
use import future to address the changes and let python2 work with our package.
https://github.com/NIT-dgp/UIP#uip-is-pretty says:
UIP Scrapes wallpapers from reddit and applies them as wallpapers on a gnome Desktop according to a schedule.
probably it should say or something similar
UIP scrapes images from reddit and applies them as a wallpaper on your gnome desktop. You can configure the schedule.
Traceback (most recent call last):
File "UIP.py", line 4, in
scheduler()
File "/home/sonu/UIP/scheduler.py", line 10, in init
self.initFetch()
File "/home/sonu/UIP/scheduler.py", line 17, in initFetch
get_images(WEBSITE)
File "/home/sonu/UIP/scrape.py", line 49, in get_images
urlretrieve(image,os.path.join(path,filename),reporthook=dlProgress)
File "/usr/lib/python3.5/urllib/request.py", line 188, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.5/urllib/request.py", line 472, in open
response = meth(req, response)
File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.5/urllib/request.py", line 510, in error
return self._call_chain(*args)
File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
We should delete wallpapers when they get too old, and also put a limit on the number of pics, in the pics directory
Right now we don't test anything it'd be nice if we add tests to our code asap
Example TIMEOUT, number of images to download, when to delete, location of the pics folder etc.
all subreddits follow similar page structure so it shouldn't be difficult to allow for different subreddits
and move this section above set UP
above the function initFetch
there's a line print("Anything")
remove this line
For example to go into the offline mode a person should
do: python3 UIP.py --offline
Once the set amount of images are downloaded, they keep on repeating and no new images are downloaded.
This needs to change, as- the more the merrier.
TSIA
it was used earlier but now its obsolete and is just sitting there with no use :P
This would make it easier for newcomers to read the guidelines.
One doesn't go all the way to check the contributing.md file to know how to contribute.
Its open source :P Keep it as open as possible.
something on the lines "Report issues found, at our github page" should be just fine :)
TSIA
just add bmp to the list in scrape.py
change from:
if link['href'].endswith(('jpg','png','jpeg'))
to
if link['href'].endswith(('jpg','png','jpeg','bmp'))
scheduler.py:1:5: E271 multiple spaces after keyword
scheduler.py:3:31: E231 missing whitespace after ','
scheduler.py:3:43: E231 missing whitespace after ','
scheduler.py:3:51: E231 missing whitespace after ','
scheduler.py:6:30: W291 trailing whitespace
scheduler.py:7:1: E302 expected 2 blank lines, found 0
scheduler.py:13:1: W293 blank line contains whitespace
scheduler.py:14:9: E265 block comment should start with '# '
scheduler.py:16:13: W291 trailing whitespace
scheduler.py:25:21: E225 missing whitespace around operator
scheduler.py:30:26: E225 missing whitespace around operator
scheduler.py:31:1: W293 blank line contains whitespace
scheduler.py:35:1: W293 blank line contains whitespace
scheduler.py:36:5: E303 too many blank lines (2)
scheduler.py:36:26: E231 missing whitespace after ','
scheduler.py:37:18: E225 missing whitespace around operator
scheduler.py:43:28: E225 missing whitespace around operator
currently no linting is done to make the code PEP8 compliant. I guess its best we use coala https://github.com/coala/coala
though if anybody has other suggestions it'd be great. CC @ghoshbishakh
$ python UIP.py
Hey this is UIP! you can use it to download images from reddit and also to schedule the setting of these images as your desktop wallpaper.
Press 1 to connect to internet or any other key to use this application in offline mode
1
1479450423.197908
No downloaded images. Try again in online mode.
Needs fixing the use of os.path.isdir combined with os.path.exists
It'd be nice to have support for different PC's maybe even windows?
Add link to #general ( https://gitter.im/NIT-dgp/General ) channel in the README.md so that reaching to the maintainers is easy for newcomers.
i think it would cool if we could add an option for not connecting to the internet and changing the wallpapers directly from the directory, all the functionality is there we just need to add an option
it would be nice to have newcommer commits as standalone commits instead of those stupid merge commits for that we'll need rultor.
it will be a great way to advertise UIP. The image should go inside an example folder and the screenshot in the readme should be under the heading example
right after set up
often the pics folder get's stale and then we get the same images repeatedly its best if there's a command to like python3 UIP.py --flush
to delete all the pics in the pics folder
/usr/lib/python3/dist-packages/bs4/init.py:181: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
The code that caused this warning is on line 4 of the file UIP.py. To get rid of this warning, change code that looks like this:
BeautifulSoup([your markup])
to this:
BeautifulSoup([your markup], "lxml")
atleast 1 from windows and 1 from mac
@nkprince007 can you post the Mac screenshot here?
It would be great to display a nicely formatted error message when the application is used in offline mode with the pics folder being empty.
it would be nice to have a download progress bar
AFAIK there's no library of this kind for python3, and it can be an awesome tool for a lot of people to use CC @nkprince007 and @DarkSouL11
There are the following PEP8 errors in UIP.py:
UIP.py:4:1: W191 indentation contains tabs
UIP.py:4:13: W292 no newline at end of file
TSIA
right now Readme states, `"applies wallpaper in a gnome desktop" change this "applies wallpaper on your desktop. Works with windows, mac and gtk based desktops on Linux"
from
RUN
to
Run
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.