Did I find the right examples for you? yes no

All Samples(52)  |  Call(26)  |  Derive(0)  |  Import(26)
Make sure that the file is writeable. Useful if our source is
read-only.

        def _make_writeable(filename):
    """
    Make sure that the file is writeable. Useful if our source is
    read-only.

    """
    import stat
    if sys.platform.startswith('java'):
        # On Jython there is no os.access()
        return
    if not os.access(filename, os.W_OK):
        st = os.stat(filename)
        new_permissions = stat.S_IMODE(st.st_mode) | stat.S_IWUSR
        os.chmod(filename, new_permissions)
        


src/r/o/rolf-HEAD/ve/lib/python2.7/site-packages/django_extensions/management/commands/create_jobs.py   rolf(Download)
import os
import sys
from django.core.management.base import AppCommand
from django_extensions.management.utils import _make_writeable
 
            try:
                shutil.copymode(path_old, path_new)
                _make_writeable(path_new)
            except OSError:
                sys.stderr.write("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new)

src/r/o/rolf-HEAD/ve/lib/python2.7/site-packages/django_extensions/management/commands/create_command.py   rolf(Download)
import os
import sys
from django.core.management.base import CommandError, AppCommand
from django_extensions.management.utils import _make_writeable
from optparse import make_option
            try:
                shutil.copymode(path_old, path_new)
                _make_writeable(path_new)
            except OSError:
                sys.stderr.write("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new)

src/r/o/rolf-HEAD/ve/lib/python2.7/site-packages/django_extensions/management/commands/create_app.py   rolf(Download)
from django_extensions.settings import REPLACEMENTS
from django_extensions.utils.dia2django import dia2django
from django_extensions.management.utils import _make_writeable
from optparse import make_option
 
            try:
                shutil.copymode(path_old, path_new)
                _make_writeable(path_new)
            except OSError:
                sys.stderr.write("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new)

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/django_extensions/management/commands/create_jobs.py   antisocial(Download)
import os
import sys
from django.core.management.base import AppCommand
from django_extensions.management.utils import _make_writeable
 
            try:
                shutil.copymode(path_old, path_new)
                _make_writeable(path_new)
            except OSError:
                sys.stderr.write("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new)

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/django_extensions/management/commands/create_command.py   antisocial(Download)
import os
import sys
from django.core.management.base import CommandError, AppCommand
from django_extensions.management.utils import _make_writeable
from optparse import make_option
            try:
                shutil.copymode(path_old, path_new)
                _make_writeable(path_new)
            except OSError:
                sys.stderr.write("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new)

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/django_extensions/management/commands/create_app.py   antisocial(Download)
from django_extensions.settings import REPLACEMENTS
from django_extensions.utils.dia2django import dia2django
from django_extensions.management.utils import _make_writeable
from optparse import make_option
 
            try:
                shutil.copymode(path_old, path_new)
                _make_writeable(path_new)
            except OSError:
                sys.stderr.write("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new)

src/d/j/django-extensions-1.3.3/django_extensions/management/commands/create_template_tags.py   django-extensions(Download)
import os
import sys
from django.core.management.base import AppCommand
from django_extensions.management.utils import _make_writeable
from optparse import make_option
            try:
                shutil.copymode(path_old, path_new)
                _make_writeable(path_new)
            except OSError:
                sys.stderr.write("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new)

src/d/j/django-extensions-1.3.3/django_extensions/management/commands/create_jobs.py   django-extensions(Download)
import os
import sys
from django.core.management.base import AppCommand
from django_extensions.management.utils import _make_writeable
 
            try:
                shutil.copymode(path_old, path_new)
                _make_writeable(path_new)
            except OSError:
                sys.stderr.write("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new)

src/d/j/django-extensions-1.3.3/django_extensions/management/commands/create_command.py   django-extensions(Download)
import os
import sys
from django.core.management.base import AppCommand
from django_extensions.management.utils import _make_writeable
from optparse import make_option
            try:
                shutil.copymode(path_old, path_new)
                _make_writeable(path_new)
            except OSError:
                sys.stderr.write("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new)

src/d/j/django-extensions-1.3.3/django_extensions/management/commands/create_app.py   django-extensions(Download)
from django_extensions.settings import REPLACEMENTS
from django_extensions.utils.dia2django import dia2django
from django_extensions.management.utils import _make_writeable
from optparse import make_option
 
            try:
                shutil.copymode(path_old, path_new)
                _make_writeable(path_new)
            except OSError:
                sys.stderr.write("Notice: Couldn't set permission bits on %s. You're probably using an uncommon filesystem setup. No problem.\n" % path_new)

  1 | 2 | 3  Next