Package imagizer :: Module imagizer
[hide private]
[frames] | no frames]

Module imagizer

source code

General library used by selector and generator. It handles images, progress bars and configuration file.

Classes [hide private]
  ModelProcessSelected
Implemantation MVC de la procedure ProcessSelected
  ModelCopySelected
Implemantation MVC de la procedure CopySelected
  ModelRangeTout
Implemantation MVC de la procedure RangeTout moves all the JPEG files to a directory named from their day and with the name according to the time
  Controler
Implémentation du contrôleur de la vue utilisant la console
  ControlerX
Implémentation du contrôleur.
  View
Implémentation de la vue.
  ViewX
Implementation of the view as a splashscren
  photo
class photo that does all the operations available on photos
  signature
  RawImage
class for handling raw images
Functions [hide private]
 
RangeTout(repository, bUseX=True)
moves all the JPEG files to a directory named from their day and with the name according to the time This is a MVC implementation
source code
 
ProcessSelected(SelectedFiles)
This procedure uses the MVC implementation of processSelected It makes a copy of all selected photos and scales them copy all the selected files to "selected" subdirectory, 20 per page
source code
 
CopySelected(SelectedFiles)
This procedure makes a copy of all selected photos and scales them copy all the selected files to "selected" subdirectory
source code
 
makedir(filen)
creates the tree structure for the file
source code
 
mkdir(filename)
create an empty directory with the given rights
source code
list of strings
findFiles(strRootDir, lstExtentions=['.jpg', '.jpeg', '.jpe', '.jfif'], bFromRoot=False)
Equivalent to: files=os.system('find "%s" -iname "*.%s"'%(RootDir,suffix)).readlines()
source code
 
ScaleImage(filename, filigrane=None)
common processing for one image : create a subfolder "scaled" and "thumb" :
source code
 
unicode_to_ascii(unicrap)
This takes a UNICODE string and replaces unicode characters with something equivalent in 7-bit ASCII.
source code
 
SmartSize(size)
print the size of files in a pretty way
source code
 
recursive_delete(strDirname)
Delete everything reachable from the directory named in "top", assuming there are no symbolic links.
source code
Variables [hide private]
  gtkInterpolation = [<enum GDK_INTERP_NEAREST of type GdkInterp...
  installdir = '/home/jerome/workspace/imagizer/imagizer'
  ConfFile = ['/etc/imagizer.conf', '/home/jerome/.imagizer', '....
  unifiedglade = '/home/jerome/workspace/imagizer/imagizer/selec...
  config = ...
  imageCache = {}
  __package__ = 'imagizer'
Function Details [hide private]

RangeTout(repository, bUseX=True)

source code 

moves all the JPEG files to a directory named from their day and with the name according to the time This is a MVC implementation

Parameters:
  • repository (string) - the name of the starting repository
  • bUseX (boolean) - set to False to disable the use of the graphical splash screen

findFiles(strRootDir, lstExtentions=['.jpg', '.jpeg', '.jpe', '.jfif'], bFromRoot=False)

source code 

Equivalent to: files=os.system('find "%s" -iname "*.%s"'%(RootDir,suffix)).readlines()

Parameters:
  • strRootDir (string) - path of the root of the search
  • lstExtentions - list of string representing interesting extensions
  • bFromRoot - start the return path from / instead of the strRootDir
Returns: list of strings
the list of the files with the given suffix in the given dir

unicode_to_ascii(unicrap)

source code 

This takes a UNICODE string and replaces unicode characters with something equivalent in 7-bit ASCII. It returns a plain ASCII string. This function makes a best effort to convert unicode characters into ASCII equivalents. It does not just strip out the Latin-1 characters. All characters in the standard 7-bit ASCII range are preserved. In the 8th bit range all the Latin-1 accented letters are converted to unaccented equivalents. Most symbol characters are converted to something meaningful. Anything not converted is deleted.

recursive_delete(strDirname)

source code 

Delete everything reachable from the directory named in "top", assuming there are no symbolic links. CAUTION: This is dangerous! For example, if top == '/', it could delete all your disk files.

Parameters:
  • strDirname (string) - top directory to delete

Variables Details [hide private]

gtkInterpolation

Value:
[<enum GDK_INTERP_NEAREST of type GdkInterpType>,
 <enum GDK_INTERP_TILES of type GdkInterpType>,
 <enum GDK_INTERP_BILINEAR of type GdkInterpType>,
 <enum GDK_INTERP_HYPER of type GdkInterpType>]

ConfFile

Value:
['/etc/imagizer.conf', '/home/jerome/.imagizer', '.imagizer']

unifiedglade

Value:
'/home/jerome/workspace/imagizer/imagizer/selector.glade'

config

Value:

Size on the images on the Screen: 600 pixels in the largest dimension
Page prefix:			  page
Number of images per page:	  20
Use Exif for Auto-Rotate:	  True
Default mode for files (octal):	  664
JPEG extensions:		 ['.jpg', '.jpeg', '.jpe', '.jfif']
Default photo repository:	  /home/photo
...