Skip to content

Commit

Permalink
Version 1.1.0
Browse files Browse the repository at this point in the history
* a python bug fixed with changing scripts name to uppercase
* fix for linux builds ( use os.path.join instead os string operations
for path )
  • Loading branch information
usta committed Apr 14, 2015
1 parent bbf9bce commit 38483a7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 23 deletions.
6 changes: 5 additions & 1 deletion ChangeLog.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
Change Log
==========
1.1.0 2015-04-14
* a python bug fixed with changing scripts name to uppercase
* fix for linux builds ( use os.path.join instead os string operations for path )

1.0.5 2015-04-12
* Raw image format extensions added
* Fix for python3 env for python2 default envs

1.0.0 2015-04-10
* First Commit to Github

Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

#
18 changes: 11 additions & 7 deletions radmyarchive/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__version__ = "1.1.0"


from fileinput import close
import exifread
import os
import shutil
import time
from .radmyarchiveexceptions import *
__version__ = "1.0.5"

class RADMyArchive:

def __init__(self, filepath, destination=".\\NewImageArchive", move=False):
class RADMyArchive:
def __init__(self, filepath, destination=".//NewImageArchive", move=False):

self._filePath = filepath
self._fileExt = os.path.splitext(self._filePath)[1]
Expand Down Expand Up @@ -48,11 +50,12 @@ def _fileOperation(self):
self._destinationFilePath)

def _createDestinationDirs(self):
path = os.path.join(self._destinationBasePath,
self.getYear(),
self.getMonth(),
self.getDay())
try:
os.makedirs(self._destinationBasePath+"\\" +
self.getYear()+"\\" +
self.getMonth()+"\\" +
self.getDay(),
os.makedirs(path,
exist_ok=True)
except:
raise CreateDirError(self._destinationBasePath,
Expand Down Expand Up @@ -86,6 +89,7 @@ def _parseDate(self):
self._imgMonth,
self._imgDay,
self._imgTime))

def _parseDateExif(self, tags):
if 'EXIF DateTimeOriginal' not in tags.keys():
if 'Image DateTime' in tags.keys():
Expand Down
19 changes: 9 additions & 10 deletions radmyarchive.py → scripts/RADMYARCHIVE.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import os.path
import sys
import getopt
from colorama import init
from termcolor import colored
import radmyarchive



def usage(exit_status):
"""Show command line usage."""
msg = ('Usage: radmyarchive.py [ -m ] SourceDirectory [ -o OutputDirectory ]\n'
msg = ('Usage: RADMYARCHIVE.py [ -m ] SourceDirectory [ -o OutputDirectory ]\n'
'RadMyArchive ( RenameAsDate My Archive ) Rearranges Image files according to their\n'
'EXIF DateTimeOriginal information.\n\nOptions:\n'
'-h --help Display usage information and exit.\n'
Expand All @@ -26,7 +25,6 @@ def usage(exit_status):
sys.exit(exit_status)



def show_version():
"""Show the program version."""
print('Version %s on Python%s' % (radmyarchive.__version__,
Expand All @@ -38,16 +36,17 @@ def main():
"""Parse command line options/arguments and execute."""
args = []
opts = []
pattern = "*" # TODO
# TODO pattern = "*"
source = ""
destination = ""
move = False
extensions = {".jpg", ".png", ".gif", ".jpeg", ".png", ".arw", ".srf", ".sr2", ".bay", ".crw", ".cr2",
".cap", ".tif", ".iiq", ".eip", ".dcs", ".dcr", ".drf", ".k25", ".kdc", ".tif", ".dng",
".erf", ".fff", ".mef", ".mos", ".mrw", ".nef", ".nrw", ".orf", ".ptx", ".pef",
".pxn", ".r3d", ".raf", ".raw", ".rw2", ".raw", ".rwl", ".dng", ".rwz", ".x3f" }
".pxn", ".r3d", ".raf", ".raw", ".rw2", ".raw", ".rwl", ".dng", ".rwz", ".x3f"}

init() #colorama - Colorful output
# colorama - Colorful output
init()

try:
arg_names = ["help", "version", "move", "output="]
Expand Down Expand Up @@ -78,8 +77,8 @@ def main():

try:
a = radmyarchive.RADMyArchive(os.path.join(source, currentFile),
destination=destination,
move=move)
destination=destination,
move=move)

print("%s --> %s" % (colored(currentFile, "green"),
colored(a.getDestinationFilePath(), "yellow")))
Expand All @@ -91,7 +90,7 @@ def main():
def listFiles(path):
"""Yield file names not starting with '.' under given path."""
if not os.path.exists(path):
print("%s : Path couldn't be found! Make sure to wrap your path between \" and \"" % colored(path,"red"))
print("%s : Path couldn't be found! Make sure to wrap your path between \" and \"" % colored(path, "red"))
usage(2)

if sys.version_info[0] == 3 and sys.version_info[1] >= 5:
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from codecs import open
from os import path
import radmyarchive

here = path.abspath(path.dirname(__file__))

with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
Expand All @@ -17,11 +16,12 @@
author="Ömer Fadıl Usta",
author_email="[email protected]",
packages=find_packages(),
scripts=["radmyarchive.py"],
scripts=["scripts/RADMYARCHIVE.py"],
url="https://github.com/usta/radmyarchive-py",
license="BSD",
keywords="exif image photo rename metadata arrange rearrange catalogue",
description="A simple photo rearranger with help of EXIF tags",
install_requires=['exifread', 'termcolor', 'colorama'],
long_description=readme_file,
classifiers=(
"Development Status :: 3 - Alpha",
Expand All @@ -31,8 +31,6 @@
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Topic :: Utilities",
),
install_requires=['ExifRead', 'termcolor', 'colorama'],
)

0 comments on commit 38483a7

Please sign in to comment.