GithubHelp home page GithubHelp logo

nitdgpos / uip Goto Github PK

View Code? Open in Web Editor NEW
19.0 6.0 45.0 19.04 MB

A library, to customize your desktop wallpapers.

Home Page: https://nitdgpos.github.io/projects/UIP

License: GNU Affero General Public License v3.0

Python 95.74% Makefile 1.86% Shell 2.39%
wallpaper uip desktop setuptools reddit gui python cross-platform-gui cross-platform desktoppr

uip's Introduction

UIP Is Pretty

Build Status Build status codecov

UIP scrapes images from reddit and unsplash, and applies them as a wallpaper on your desktop(with configurable schedule). Works with Windows, Mac and Gtk based desktops on Linux.

Examples Of UIP Wallpapers

alt text alt text alt text

Set Up

For Users:

To install UIP, just run the command

sudo pip install UIP

For Testers & Developers:

First clone the source repository from github using the command

git clone https://github.com/NIT-dgp/UIP.git

To install the requirements run the command

sudo python3 setup.py install

Note: We only support Python 3.5 or later versions.

Note: make sure you have setuptools, to do that run: pip install setuptools.

Note: there is no sudo for windows as well as when you have root privileges. Just run commands without sudo

Note: some setups use python instead of python3 and pip3 instead of pip

Note: For some OS' you might need to install Imagetk(needed in our GUI) separately for eg: in Ubuntu you can install it by: sudo apt-get install python3-pil.imagetk

Run

To run just type

UIP

from anywhere inside the terminal/console.

If you want to try out our experimental GUI feature: use: UIP --ui

To install requirements for experimental GUI, run: pip install -r gui-requirements.txt

For help use UIP --help

Contact Us

https://gitter.im/NIT-dgp/General

How To Package

To package into source distribution, run the following command

python setup.py sdist

How to test? (this installs UIP to your library)

cd dist/
tar xzf UIP-<version-no>.tar.gz
cd UIP-<version-no>/
python setup.py install

How to run?

UIP

How To Contribute

UIP is in its very early development stage, you can go over the issues on the github issues page and send in a PR.

your commits in the PR should be of the form:

shortlog: commit message

commit body
Fixes <issue number>

where short log is the area/filename where you make the change commit message is the very brief description of the change made by you and any other additional details go into the commit body.

Note: If you're an absolute newcomer, these sources might help you out. Though keep in mind some of the standards are different.

https://coala.io/newcomer

https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud

https://try.github.io/levels/1/challenges/1

Testing

While developing, to test, you should first install the test-requirements by running:

pip install -r test-requirements.txt

then test your work by the command:

pytest

If you want to lint your files you can run

coala

and commit all changes suggested

Do remember to keep your master branch updated at all times and always work on a different branch.

Happy coding :)

uip's People

Contributors

abhay-raizada avatar abhinavgpt avatar akshatnitd avatar aniq55 avatar darksoul11 avatar hackrush01 avatar hassi2016 avatar kirti0808 avatar lohani2280 avatar mohitshaw avatar nehau9 avatar nemani avatar nkprince007 avatar sachin-13 avatar sonalkr132 avatar sreeparna0795 avatar ssg2526 avatar swati707 avatar teja-315 avatar trump16 avatar vartika-arora avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

uip's Issues

organise code into folders

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

Exit UIP cleanly with ctrl + C

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)

Add option for not connecting to the internet

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

Use rultor for deployement

it would be nice to have newcommer commits as standalone commits instead of those stupid merge commits for that we'll need rultor.

HTTP Error 403

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

Flush images

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.

PEP8 errors in UIP.py

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

Specify the parser for better output

/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")

doesn't download wallpapers when pics directory exists and is empty

$ 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

add support for bmp files

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'))

Add support for MacOS

sadly none of our developers have a mac yet, so its impossble for us to test this right now :(

PEP8 errors in scheduler.py

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

Put screenshot of a UIP wallpaper in Readme

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

Contributing.md should be added to readme.md

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.

option for other subreddits

all subreddits follow similar page structure so it shouldn't be difficult to allow for different subreddits

Nice Exit message

print Exiting UIP hope you had a nice time :) before system exit in UIP.py

Add command to Empty pics folder

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

Correct Readme to write supported OS'

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"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.