Skip to content

Commit

Permalink
Qt4 Designer ile on numara bir gui hazırlandı!
Browse files Browse the repository at this point in the history
  • Loading branch information
ozcanyarimdunya committed Aug 21, 2016
1 parent ea0a272 commit 4ba3057
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 48 deletions.
47 changes: 0 additions & 47 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,61 +1,14 @@
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Created by .ignore support plugin (hsz.mobi)
22 changes: 22 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion [Proje - 20] Qt Designer ile Tv Yayın Akışı/1.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import sys
import urllib
import re

from BeautifulSoup import *
from PyQt4.QtGui import *
Expand Down Expand Up @@ -98,6 +97,7 @@ def no_connection():
self.browser.clear()
self.browser.append("İnternet bağlantınızı kontrol edin.".decode('utf-8'))


if self.combo.currentIndex() == 0:
self.browser.clear()
about = "\nBu program @ozcaan11 tarafından \n" \
Expand Down
98 changes: 98 additions & 0 deletions [Proje - 22] Qt4 Designer ListWidgets/scrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# -*- coding: utf-8 -*-
from __future__ import print_function

import os
import urllib

from BeautifulSoup import *

BASE_URL = "http://www.tvyayinakisi.com/"
ALL_CHANNELS_URL = "http://www.tvyayinakisi.com/yayin-akislari"
BROADCASTING_URL = "http://www.tvyayinakisi.com/" # + CHANNEL_URL


class AllChannels:
"""
This is the class which scrap the BASE_URL!
"""

def __init__(self):
self.soup = BeautifulSoup(urllib.urlopen(ALL_CHANNELS_URL))

def getChannels(self):
channels = []
ch = {}
for c, div in enumerate(self.soup.findAll("div", {"class": re.compile(r'two columns.*')})):
ch["link" + str(c)] = div.a['href']
ch["name" + str(c)] = div.find("a").text
ch["title" + str(c)] = div.a['title']
channels.append(ch)
return channels

def getChannelLinks(self):
channel_urls = []
for div in self.soup.findAll("div", {"class": re.compile(r'two columns.*')}):
channel_urls.append(div.a['href'])
return channel_urls

def getChannelNames(self):
channel_name = []
for div in self.soup.findAll("div", {"class": re.compile(r'two columns.*')}):
channel_name.append(div.find("a").text)
return channel_name

def getTitles(self):
titles = []
for div in self.soup.findAll("div", {"class": re.compile(r'two columns.*')}):
titles.append(div.a['title'])
return titles

def getCount(self):
return len(self.soup.findAll("div", {"class": re.compile(r'two columns.*')}))

def downloadIcons(self):
if not os.path.exists("icons"):
os.mkdir("icons")
for div in self.soup.findAll("div", {"class": re.compile(r'two columns.*')}):
channel_url = div.a['href']
icon_url = div.find("img")["src"]
if not os.path.isfile("icons" + os.sep + str(channel_url + ".png")):
try:
urllib.urlretrieve(str(BASE_URL + icon_url), "icons" + os.sep + str(channel_url + ".png"))
except:
pass


class SingleChannels:
def __init__(self, url):
self.url = url
self.soup = BeautifulSoup(urllib.urlopen(BROADCASTING_URL + self.url))

def getBroadcasting(self):
broadcast = []
for div in self.soup.findAll("div", {"class": re.compile('row*')}):
time = div.find("div", {"class": "two columns time"})
program = div.find("div", {"class": "ten columns"})
if not (time is None and program is None):
if str(program.string).__contains__("'"):
str(program.string)
broadcast.append(time.string + " " + program.string.replace("'", "'").replace("’", "'"))
broadcast.pop(0)
return broadcast


"""
urllib.urlretrieve(url,photo_name)
# This is for the gui
a = AllChannels()
for i in a.getChannelLinks():
try:
s = SingleChannels(i)
for j in s.getBroadcasting():
print(j)
except:
pass
print("\n============================\n")
"""

0 comments on commit 4ba3057

Please sign in to comment.