Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython

roopeshv.utils is unavailable in PyPM, because there aren't any builds for it in the package repositories. Click the linked icons to find out why.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.0.2 Failed View build log
Windows (64-bit)
0.0.2 Failed View build log
Mac OS X (10.5+)
0.0.2 Failed View build log
Linux (32-bit)
0.0.2 Failed View build log
Linux (64-bit)
0.0.2 Failed View build log
 
Links
Author
License
LGPLv3
Dependencies
Lastest release
version 0.0.2 on Jan 5th, 2011

Introduction

This is a collection of utility functions, which can simple, and are a whole lot useful.

This version of the utility functions includes only those dealing with the files, directories, full paths of those.

functions

Get the expanded path of directory dir_

The home directory of ~ is /home/rv and home directory of zope is /usr/local/zope

>>> full_path('~')
'/home/rv'
>>> full_path('~zope')
'/usr/local/zope'

For a non existant user ~test, the result will be current_directory/~test

>>> full_path('~test')
'/home/rv/expertpy/roopeshv.utils/roopeshv/utils/~test'

Join the list to form a directory path

This is just a convenience function.

>>> join_path('~', 'test')
'~/test'
>>> join_path('/home/rv', 'test')
'/home/rv/test'
>>> join_path('test', 'README.txt')
'test/README.txt'

determine if dir_ is a directory.

>>> is_directory('.')
True
>>> is_directory('~')
True
>>> is_directory('/')
True
>>> is_directory('no/such/directory')
False

get a list of files(absolute path) in directory dir_

the .directory happens to exist in my computer, but for now
the function works as intended.

>>> get_files_in('/home/')
['/home/.directory']
>>> '/etc/passwd' in get_files_in('/etc/')
True

get a list of directories(absolute path) in directory dir_

>>> sorted(get_directories_in('/home/'))
['/home/guest', '/home/rv']
>>> '/home/rv/Desktop' in get_directories_in('~')
True

get the latest file in given directory

>>> get_latest_file_in('~/expertpy/roopeshv.utils', prefix=[])

History

version 0.0.1
  • added few convenience functions

Subscribe to package updates

Last updated Jan 5th, 2011

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.