-
Notifications
You must be signed in to change notification settings - Fork 4
lister.py #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seoyoung-0
wants to merge
7
commits into
wit-korea:master
Choose a base branch
from
seoyoung-0:seo0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
lister.py #5
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
19d54d1
lister.py
seoyoung-0 067725b
folder add
seoyoung-0 405b354
seoyoung-0/lister.py
seoyoung-0 6cc8b16
lister.py 수정 _dst.py using tabto4.py
seoyoung-0 d23bd50
week3 modify
seoyoung-0 2ad065f
instagram
seoyoung-0 e0fcbb8
instagram
seoyoung-0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import os | ||
| import sys | ||
| import random | ||
|
|
||
| file_list=[] | ||
|
|
||
| def search(dir): | ||
| files = os.listdir(dir) | ||
| for file in files: | ||
| fullFilename = os.path.join(dir, file) | ||
| if os.path.isdir(fullFilename): | ||
| file_list.append(fullFilename) | ||
| search(fullFilename) | ||
| else: | ||
| file_list.append(fullFilename) | ||
|
|
||
|
|
||
|
|
||
| def searchTwo(dir,third): | ||
| files = os.listdir(dir) | ||
| for file in files: | ||
| fullFilename = os.path.join(dir, file) | ||
| if os.path.isdir(fullFilename): | ||
| for ig in third: | ||
| if ig in fullFilename: | ||
| break | ||
| else: | ||
| if fullFilename.endswith(ig): | ||
| searchTwo(fullFilename,third) | ||
|
|
||
| else: | ||
| for ig in third: | ||
| if ig in fullFilename: | ||
| break | ||
| else: | ||
| file_list.append(fullFilename) | ||
|
|
||
|
Comment on lines
+22
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 들여쓰기는 줄마다 4칸씩 주는 것이 PEP8 가이드입니다. |
||
| def print_list(list): | ||
| for file_name in list: | ||
| print(file_name) | ||
|
|
||
|
|
||
| def main(): | ||
| if len(sys.argv) == 2: | ||
| searchDir=sys.argv[1] | ||
| search(searchDir) | ||
| print_list(file_list) | ||
| elif len(sys.argv) ==3: | ||
| searchDir=sys.argv[1] | ||
| second = sys.argv[2] | ||
| if second =="random": | ||
| search(searchDir) | ||
| random.shuffle(file_list) | ||
| print_list(file_list) | ||
| elif second.startswith("ignore"): | ||
| third=second[7:].split('-') | ||
| print("ignored:",third) | ||
| searchTwo(searchDir, third) | ||
| print_list(file_list) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import os | ||
| import sys | ||
| import random | ||
|
|
||
| file_list=[] | ||
|
|
||
| def search(dir): | ||
| files = os.listdir(dir) | ||
| for file in files: | ||
| fullFilename = os.path.join(dir, file) | ||
| if os.path.isdir(fullFilename): | ||
| file_list.append(fullFilename) | ||
| search(fullFilename) | ||
| else: | ||
| file_list.append(fullFilename) | ||
|
|
||
|
|
||
|
|
||
| def searchTwo(dir,third): | ||
| files = os.listdir(dir) | ||
| for file in files: | ||
| fullFilename = os.path.join(dir, file) | ||
| if os.path.isdir(fullFilename): | ||
| for ig in third: | ||
| if ig in fullFilename: | ||
| break | ||
| else: | ||
| if fullFilename.endswith(ig): | ||
| searchTwo(fullFilename,third) | ||
|
|
||
| else: | ||
| for ig in third: | ||
| if ig in fullFilename: | ||
| break | ||
| else: | ||
| file_list.append(fullFilename) | ||
|
|
||
| def print_list(list): | ||
| for file_name in list: | ||
| print(file_name) | ||
|
|
||
|
|
||
| def main(): | ||
| if len(sys.argv) == 2: | ||
| searchDir=sys.argv[1] | ||
| search(searchDir) | ||
| print_list(file_list) | ||
| elif len(sys.argv) ==3: | ||
| searchDir=sys.argv[1] | ||
| second = sys.argv[2] | ||
| if second =="random": | ||
| search(searchDir) | ||
| random.shuffle(file_list) | ||
| print_list(file_list) | ||
| elif second.startswith("ignore"): | ||
| third=second[7:].split('-') | ||
| print(third) | ||
| searchTwo(searchDir, third) | ||
| print_list(file_list) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import os | ||
| import sys | ||
| import random | ||
|
|
||
| file_list=[] | ||
|
|
||
| def search(dir): | ||
| files = os.listdir(dir) | ||
| for file in files: | ||
| fullFilename = os.path.join(dir, file) | ||
| if os.path.isdir(fullFilename): | ||
| file_list.append(fullFilename) | ||
| search(fullFilename) | ||
| else: | ||
| file_list.append(fullFilename) | ||
|
|
||
|
|
||
|
|
||
| def searchTwo(dir,third): | ||
| files = os.listdir(dir) | ||
| for file in files: | ||
| fullFilename = os.path.join(dir, file) | ||
| if os.path.isdir(fullFilename): | ||
| for ig in third: | ||
| if ig in fullFilename: | ||
| break | ||
| else: | ||
| if fullFilename.endswith(ig): | ||
| searchTwo(fullFilename,third) | ||
|
|
||
| else: | ||
| for ig in third: | ||
| if ig in fullFilename: | ||
| break | ||
| else: | ||
| file_list.append(fullFilename) | ||
|
|
||
| def print_list(list): | ||
| for file_name in list: | ||
| print(file_name) | ||
|
|
||
|
|
||
| def main(): | ||
| if len(sys.argv) == 2: | ||
| searchDir=sys.argv[1] | ||
| search(searchDir) | ||
| print_list(file_list) | ||
| elif len(sys.argv) ==3: | ||
| searchDir=sys.argv[1] | ||
| second = sys.argv[2] | ||
| if second =="random": | ||
| search(searchDir) | ||
| random.shuffle(file_list) | ||
| print_list(file_list) | ||
| elif second.startswith("ignore"): | ||
| third=second[7:].split('-') | ||
| print(third) | ||
| searchTwo(searchDir, third) | ||
| print_list(file_list) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import sys | ||
|
|
||
| src = sys.argv[1] | ||
| dst = sys.argv[2] | ||
|
|
||
| f=open(src) | ||
| tab_content = f.read() | ||
| f.close() | ||
|
|
||
| space_content = tab_content.replace("\t"," "*4) | ||
|
|
||
| f = open(dst, 'w') | ||
| f.write(space_content) | ||
| f.close() |
Empty file.
Binary file added
BIN
+143 Bytes
seoyoung/seoyoung-0/week5/accounts/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added
BIN
+184 Bytes
seoyoung/seoyoung-0/week5/accounts/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added
BIN
+181 Bytes
seoyoung/seoyoung-0/week5/accounts/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from django.contrib import admin | ||
|
|
||
| # Register your models here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from django.apps import AppConfig | ||
|
|
||
|
|
||
| class AccountsConfig(AppConfig): | ||
| name = 'accounts' |
Empty file.
Binary file added
BIN
+154 Bytes
seoyoung/seoyoung-0/week5/accounts/migrations/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from django.db import models | ||
|
|
||
| # Create your models here. |
20 changes: 20 additions & 0 deletions
20
seoyoung/seoyoung-0/week5/accounts/templates/accounts/login.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| {% extends 'base.html' %} | ||
| {% block title %} | ||
| {% endblock %} | ||
|
|
||
| {% block content %} | ||
| <div class="row"> | ||
| <div class="col"></div> | ||
| <div class="col-6"> | ||
| <div class="alert alert-primary" role="alert"> | ||
| Please enter your login information.</div> | ||
| <form action="" method="post"> | ||
| {% csrf_token %} | ||
| {{form.as_p}} | ||
| <input type="submit" value="login" class="btn btn-outline-primary"> | ||
| </form> | ||
| </div> | ||
| <div class="col"></div> | ||
|
|
||
| </div> | ||
| {% endblock %} |
16 changes: 16 additions & 0 deletions
16
seoyoung/seoyoung-0/week5/accounts/templates/accounts/logout.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| {% extends 'base.html' %} | ||
| {% block title %} | ||
| {% endblock %} | ||
|
|
||
| {% block content %} | ||
| <div class="row"> | ||
| <div class="col"></div> | ||
| <div class="col-6"> | ||
| <div class="alert alert-primary" role="alert"> | ||
| 로그아웃 되었습니다. </div> | ||
|
|
||
| <a href="{% url 'accounts:login' %}" class="btn btn-outline-success">login 하기 </a> | ||
| </div> | ||
| <div class="col"></div> | ||
| </div> | ||
| {% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from django.test import TestCase | ||
|
|
||
| # Create your tests here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| from django.urls import path | ||
| from django.contrib.auth.views import LoginView, LogoutView | ||
|
|
||
|
|
||
| app_name = "accounts" | ||
|
|
||
| urlpatterns = [ | ||
| path('login/', LoginView.as_view(template_name = 'accounts/login.html'), name='login'), | ||
| path('logout/', LogoutView.as_view(template_name = 'accounts/logout.html'), name='logout' ), | ||
|
|
||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from django.shortcuts import render | ||
|
|
||
| # Create your views here. |
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>{% block title %} {% endblock %}</title> | ||
| <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" | ||
| integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> | ||
| </head> | ||
|
|
||
| <body> | ||
| {% load static %} | ||
| <style> | ||
| .btn-like{ | ||
| display: inline-block; | ||
| width: 50px; | ||
| height: 50px; | ||
| background:url({% static 'images/instagramicon.png' %}); | ||
| background-position: -100px -400px; | ||
| text-indent: -9999px; | ||
| overflow:hidden; | ||
| border:none; | ||
| } | ||
| .btn-like.active{ | ||
| display: inline-block; | ||
| width: 50px; | ||
| height: 50px; | ||
| background:url({% static 'images/instagramicon.png' %}); | ||
| background-position: -50px -400px; | ||
| text-indent: -9999px; | ||
| overflow:hidden; | ||
| border:none; | ||
| } | ||
| .btn-favorite{ | ||
| display: inline-block; | ||
| width: 50px; | ||
| height: 50px; | ||
| background:url({% static 'images/instagramicon.png' %}); | ||
| background-position: -515px -150px; | ||
| text-indent: -9999px; | ||
| overflow:hidden; | ||
| border:none; | ||
| } | ||
| .btn-favorite.active{ | ||
| display: inline-block; | ||
| width: 50px; | ||
| height: 50px; | ||
| background:url({% static 'images/instagramicon.png' %}); | ||
| background-position: -515px -100px; | ||
| text-indent: -9999px; | ||
| overflow:hidden; | ||
| border:none; | ||
| } | ||
|
|
||
| </style> | ||
|
|
||
| <nav class="navbar navbar-expand-lg navbar-dark bg-primary"> | ||
| <a class="navbar-brand" href="#">instagram</a> | ||
| <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" | ||
| aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation"> | ||
| <span class="navbar-toggler-icon"></span> | ||
| </button> | ||
|
|
||
| <div class="collapse navbar-collapse" id="navbarTogglerDemo02"> | ||
| <ul class="navbar-nav mr-auto mt-2 mt-lg-0"> | ||
| <li class="nav-item active"> | ||
| <a class="nav-link" href="{% url 'photo:index' %}"> Home <span class="sr-only">(current)</span></a> | ||
| </li> | ||
| {% if user.is_authenticated %} | ||
| <li class="nav-item"> | ||
| <a class="nav-link" href="{% url 'photo:create' %}">사진 올리기<span class="sr-only">(current)</span></a> | ||
| </li> | ||
| <li class="nav-item"> | ||
| <a class="nav-link" href="{% url 'accounts:logout' %}">Logout<span class="sr-only">(current)</span></a> | ||
| </li> | ||
| {% else %} | ||
| <li class="nav-item active"> | ||
| <a class="nav-link" href="{% url 'accounts:login' %}">Login <span class="sr-only">(current)</span></a> | ||
| </li> | ||
| {% endif %} | ||
| </ul> | ||
| <form class="form-inline my-2 my-lg-0"> | ||
| <input class="form-control mr-sm-2" type="search" placeholder="Search"> | ||
| <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button> | ||
| </form> | ||
| </div> | ||
| </nav> | ||
| <div class="container"> | ||
| {% if messages %} | ||
| <div class="row"> | ||
| <div class="col"></div> | ||
| <div class="col-6"> | ||
| {% for message in messages %} | ||
| <div class="alert alert-{{message.tag}}">{{message}}</div> | ||
| {% endfor %} | ||
| </div> | ||
| <div class="col"></div> | ||
| </div> | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| {% block content %} | ||
| {% endblock %} | ||
|
|
||
|
|
||
|
|
||
|
|
||
| <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" | ||
| integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" | ||
| crossorigin="anonymous"></script> | ||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" | ||
| integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" | ||
| crossorigin="anonymous"></script> | ||
| <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" | ||
| integrity="sha384-JjSyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" | ||
| crossorigin="anonymous"></script> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dir, thirdsearch_twoThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리뷰 감사드립니다.
참고하겠습니다.