Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(0)  |  Derive(0)  |  Import(8)

src/n/a/Naked-0.1.30/lib/Naked/toolshed/system.py   Naked(Download)
import sys
import os
from Naked.settings import debug as DEBUG_FLAG
 
#------------------------------------------------------------------------------
def filename(filepath):
    try:
        return os.path.basename(filepath)
    except Exception as e:
        if DEBUG_FLAG:
def file_extension(filepath):
    try:
        return os.path.splitext(filepath)[1]
    except Exception as e:
        if DEBUG_FLAG:
def directory(filepath):
    try:
        return os.path.dirname(filepath)
    except Exception as e:
        if DEBUG_FLAG:
def make_path(*path_list):
    try:
        return os.path.join(*path_list)
    except Exception as e:
        if DEBUG_FLAG:

src/n/a/Naked-0.1.30/lib/Naked/toolshed/file.py   Naked(Download)
#!/usr/bin/env python
# encoding: utf-8
 
import sys
from Naked.settings import debug as DEBUG_FLAG
            self.append_utf8(text) #try writing as utf-8
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).")
            raise e
                appender.write(norm_text)
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).")
            raise e
                gzip_writer.write(binary_data)
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).")
            raise e
            self.write_utf8(text) # attempt to write with utf-8 encoding
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).")
            raise e

src/n/a/Naked-0.1.30/lib/Naked/toolshed/shell.py   Naked(Download)
import sys
import subprocess
from Naked.settings import debug as DEBUG_FLAG
 
#------------------------------------------------------------------------------
            sys.stderr.write(str(cpe.output))
    except Exception as e:
        if DEBUG_FLAG:
            sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).")
        raise e
        return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable)
    except Exception as e:
        if DEBUG_FLAG:
            sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).")
        raise e
        return response_obj
    except Exception as e:
        if DEBUG_FLAG:
            sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).")
        raise e
        return execute(rb_command) # return result of execute() of the ruby file
    except Exception as e:
        if DEBUG_FLAG:
             sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).")
        raise e

src/n/a/Naked-0.1.30/lib/Naked/toolshed/network.py   Naked(Download)
import sys
import requests
from Naked.settings import debug as DEBUG_FLAG
 
#------------------------------------------------------------------------------
            return False
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)")
            raise e
            return False
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)")
            raise e
            return False
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)")
            raise e
            return False
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)")
            raise e

src/n/a/Naked-0.1.30/lib/Naked/commandline.py   Naked(Download)
#!/usr/bin/env python
# encoding: utf-8
 
import sys
from Naked.settings import debug as DEBUG_FLAG
                return False
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: Validation of application error in the app_validates() method (Naked.commandline.py).")
            raise e
            return self.argobj._getArgNext(recipient_position)
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: Error parsing argument with arg() method (Naked.commandline.py).")
            raise e
                return False # if command is missing, return false
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: Error parsing command with command() method (Naked.commandline.py).")
            raise e
    def command_arg(self):
        try:
            return self.arg1
        except Exception as e:
            if DEBUG_FLAG:

src/n/a/Naked-0.1.30/lib/Naked/toolshed/casts.py   Naked(Download)
 
from Naked.toolshed.types import NakedObject, XFSet, XDict, XList, XQueue, XSet, XString, XTuple
from Naked.settings import debug as DEBUG_FLAG
 
#------------------------------------------------------------------------------
def nobj(attributes={}):
    try:
        return NakedObject(attributes)
    except Exception as e:
        if DEBUG_FLAG:
        raise TypeError("Attempted to cast to a XDict with an incompatible type")
    except Exception as e:
        if DEBUG_FLAG:
            print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).")
        raise e
        raise TypeError("Attempted to cast to a XList with an incompatible type")
    except Exception as e:
        if DEBUG_FLAG:
            print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).")
        raise e
        raise TypeError("Attempted to cast to a XQueue with an incompatible type")
    except Exception as e:
        if DEBUG_FLAG:
            print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).")
        raise e

src/n/a/Naked-0.1.30/lib/Naked/toolshed/types.py   Naked(Download)
#!/usr/bin/env python
# encoding: utf-8
 
import sys
from Naked.settings import debug as DEBUG_FLAG
            return self
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)")
            raise e
            return self
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)")
            raise e
            return self
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)")
            raise e
            return self
        except Exception as e:
            if DEBUG_FLAG:
                sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)")
            raise e

src/n/a/Naked-0.1.30/lib/Naked/toolshed/state.py   Naked(Download)
#!/usr/bin/env python
# encoding: utf-8
 
from Naked.settings import debug as DEBUG_FLAG
from Naked.toolshed.system import cwd