code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
#!/usr/bin/env python
#
import sys
sys.path.append("..")
import config
import jpegops
if __name__=='__main__':
if len(sys.argv) < 2:
print "Usage: %s <jpg files>" % sys.argv[0]
else:
for file in sys.argv[1:]:
jpegops.rotate( file )
| Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | Python |
# This is the version of this source code.
manual_verstr = "1.5"
auto_build_num = "211"
verstr = manual_verstr + "." + auto_build_num
try:
from pyutil.version_class import Version as pyutil_Version
__version__ = pyutil_Version(verstr)
except (ImportError, ValueError):
# Maybe there is no pyutil insta... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off o... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | Python |
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
import Cookie
import datetime
import time
import email.utils
import calendar
import base64
import hashlib
import hmac
import re
import logging
# Ripped from the Tornado Framework's web.py
# http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09
#
# Tornado is licensed under the Apache Licen... | Python |
# Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Early, and incomplete implementation of -04.
#
import re
import urllib
RESERVED = ":/?#[]@!$&'()*+,;="
OPERATOR = "+./;?|!@"
EXPLODE = "*+"
MODIFIER = ":^"
TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE)
VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part... | Python |
#!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | Python |
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | Python |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | Python |
from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright... | Python |
#!/usr/bin/env python
#
# Copyright (c) 2002, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this ... | Python |
#!/usr/bin/env python
import sys, time, os, urllib2, shelve, string, xmltramp, mimetools, mimetypes, hashlib, webbrowser, urllib
#
# uploadr2set.py
#
# Upload images placed within a directory to your Flickr account and add them to a newly created
# photoset according to the directory they're in.
#
# ... | Python |
#!/usr/bin/env python
import sys, time, os, urllib2, shelve, string, xmltramp, mimetools, mimetypes, hashlib, webbrowser, urllib
#
# uploadr2set.py
#
# Upload images placed within a directory to your Flickr account and add them to a newly created
# photoset according to the directory they're in.
#
# ... | Python |
"""xmltramp: Make XML documents easily accessible."""
__version__ = "2.17"
__author__ = "Aaron Swartz"
__credits__ = "Many thanks to pjz, bitsko, and DanC."
__copyright__ = "(C) 2003-2006 Aaron Swartz. GNU GPL 2."
if not hasattr(__builtins__, 'True'): True, False = 1, 0
def isstr(f): return isinstance... | Python |
#!/usr/bin/python
#encoding=utf-8
#file_name = get_tax.py
from select_ import select
from oracle import Oracle
def getTax(oracle, staff_id):
where = {'staff_id':staff_id, 'state':'instance'}
from_sql = '''
from
(select *
... | Python |
# -*- coding:UTF-8 -*-
#from types import *
from staff import upperLevel
from update_ import update
from public import addZero
from public import getOperType
from distri import getDistriInfo
from distri import checkBeginEndNbr
from distri import insertDistriLog
from distri import insertDistriAsSplit
from distri impor... | Python |
#!/usr/bin/python
#encoding=utf-8
#file_name=public.py
def addZero(length, short):
value = str(short)
while(len(value)<length):
value = '0'+value
return value
def getOperType(tax_begin_nbr, tax_end_nbr, hold_tax_begin_nbr,
hold_tax_end_nbr):
'''取得号段类型
in: tax_begin_nbr, tax_end_nbr, hol... | Python |
# -*- coding:UTF-8 -*-
import hashlib
from select_ import select
from update_ import update
from insert_ import insert
from insert_ import insertLog
from exp import Warning_
def upperLevel(oracle,upper_staff,lower_staff):
''' 判断工号是否为上下级'''
sql = '''
select *
from staff
where staff_id... | Python |
# -*- coding:UTF-8 -*-
def right(values, oracle = None):
if(oracle != None):
oracle.commit()
return values
def error(failure, oracle = None):
if(oracle != None):
oracle.rollback()
return failure
| Python |
# -*- coding:UTF-8 -*-
from select_ import select
from update_ import update
from insert_ import insert
from insert_ import insertLog
from datetime import datetime
import threading
from exp import Warning_
from delete import delete
def getUpdateInfo(oracle):
'''查询信息'''
select_colums = ['id', 'table_name', 'par... | Python |
#!/usr/bin/env python
#encoding=utf-8
#file_name=abstract_tax.py
from insert_ import insertLog
from insert_ import insert
from update_ import update
from distri import getNextVal
from delete import delete
class AbstractTax:
def __init__(self, oracle, **args):
self.oracle = oracle
self.tax_begin_nb... | Python |
#!/usr/bin/python
#encoding=utf-8
#file_name = use_tax.py
from update_ import update
from insert_ import insertLog
from get_tax import getTax
from oracle import Oracle
class UseTax:
def __init__(s, oracle, **args):
s.oracle = oracle
s.staff_id = args['staff_id']
s.tax_code = args['tax_code']... | Python |
# -*- coding:UTF-8 -*-
from oracle import Oracle
from exp import Warning_
def select(oracle, select_colums, sql, where_dic = None, and_the = None,
bind_dic = None):
'''select_colums list 要查的值
sql
where_dic 哪个字段什么条件
'''
values = []
if(len(select_colums) == 0):
raise Exception, '未... | Python |
# -*- coding:UTF-8 -*-
import traceback
import sys
from twisted.python import log
def getExcInfo():
#记录twited 日志
log.err()
info = sys.exc_info()
#print type(info[0])
exp_type = str(info[0])
if(info[0] == Warning_):
'是waring'
print type(info[0])
print exp_type
exc_... | Python |
#! /usr/bin/env python
# ptags
#
# Create a tags file for Python programs, usable with vi.
# Tagged are:
# - functions (even inside other defs or classes)
# - classes
# - filenames
# Warns about files it cannot open.
# No warnings about duplicate tags.
import sys, re, os
tags = [] # Modified global variable!
def... | Python |
# -*- coding:UTF-8 -*-
import xml.etree.ElementTree as ElementTree
def getPrivilege(oracle, staff_id):
'''从数据库中获取所有权限信息'''
privilege_dic = {}
dic = {'privilege_id':'1', 'staff_id':staff_id}
sql = '''
select
p.privilege_id,
p.parent_privilegeid,
... | Python |
#! /usr/bin env python
#encoding=utf-8
#file_name = print.py
from select_ import select
from oracle import Oracle
def getSeq(oracle, seq_name):
'''get seq use seq_name'''
select_colums = ['%s.nextval id'%seq_name]
sql = ' from dual'
return select(oracle, select_colums, sql)[0]['id']
if __name__ == ... | Python |
# -*- coding:UTF-8 -*-
from insert_ import insert
from insert_ import insertLog
from distri import insertDistriLog
from update_ import update
from distri import getDistriInfo
from public import getOperType
from public import addZero
import pool
from oracle import Oracle
from exp import Warning_
def instanceTax(oracle,... | Python |
# -*- coding:UTF-8 -*-
from select_ import select
from update_ import update
from insert_ import insert
from insert_ import insertLog
from exp import Warning_
from delete import delete
def addRole(oracle, **args):
'''增加角色 dic: role_id'''
select_colums = ['role_id','name']
where_dic = {}
where_dic['role_... | Python |
# -*- coding:UTF-8 -*-
from twisted.internet import defer
from hello import hello
from get_tax import *
from staff import *
from retail import *
from hand import handPrint
from staff_role import addStaffRole
from staff_role import delStaffRole
from oracle import Oracle
from call_back import right,error
from exp imp... | Python |
#!/usr/bin/python
#encoding=utf-8
#file_name=oracle.py
import os
import cx_Oracle
import sys
from read_ini import read_db_info
class Oracle():
''' open oracle connetction get table_name and index info '''
pool = None
def __init__(self):
if(Oracle.pool is None):
getPool()
self.db ... | Python |
# -*- coding:UTF-8 -*-
from select_ import select
from insert_ import insertLog
def selectPool(oracle, select_colums, where_dic):
'''查询pool表'''
sql = "from pool "
return select(oracle, select_colums, sql, where_dic)
def updatePool(oracle, update_dic, where_dic):
'''更新pool表'''
sql = "update pool set ... | Python |
# -*- coding:UTF-8 -*-
from select_ import select
def initStaffId(oracle, bss_org_id):
sql = '''
insert into staff_report select staff_id from staff where bss_org_id in
(select bss_org_id
from bss_org
connect by prior bss_org_id = bss_parent_org_id
start with bss_org... | Python |
# -*- coding:UTF-8 -*-
from twisted.web import resource, server
from pyamf.remoting.gateway.twisted import TwistedGateway
from pyamf.remoting.gateway import expose_request
from exp import getExcInfo
from oracle import Oracle
from call_back import right,error
from twisted.internet import defer
from twisted.internet ... | Python |
# -*- coding:UTF-8 -*-
''' 发票作废 '''
from oracle import Oracle
from pool import selectPool
from pool import updatePool
from select_ import select
from update_ import update
from datetime import datetime
from insert_ import insertLog
def nullifyTax(oracle, dic):
''' 发票作废
tax_code
tax_nbr
oper... | Python |
#!/usr/bin/env python
#encoding=utf-8
#file_name=abstract_tax.py
from insert_ import insertLog
from insert_ import insert
from update_ import update
from distri import getNextVal
from delete import delete
class AbstractTax:
def __init__(self, oracle, **args):
self.oracle = oracle
self.tax_begin_nb... | Python |
#!/usr/bin/python
#encoding=utf-8
#file_name=public.py
def addZero(length, short):
value = str(short)
while(len(value)<length):
value = '0'+value
return value
def getOperType(tax_begin_nbr, tax_end_nbr, hold_tax_begin_nbr,
hold_tax_end_nbr):
'''取得号段类型
in: tax_begin_nbr, tax_end_nbr, hol... | Python |
#! /usr/bin/env python
# ptags
#
# Create a tags file for Python programs, usable with vi.
# Tagged are:
# - functions (even inside other defs or classes)
# - classes
# - filenames
# Warns about files it cannot open.
# No warnings about duplicate tags.
import sys, re, os
tags = [] # Modified global variable!
def... | Python |
#!/usr/bin/env python
#encoding=utf-8
import hashlib
from select_ import select
from update_ import update
from insert_ import insert
from insert_ import insertLog
from exp import Warning_
def login(oracle, **args):
'''登录工号 staff_id, passwd'''
for k, v in args.items():
exec "%s = '%s'"%(k,v)
sele... | Python |
#!/usr/bin/python
#encoding=utf-8
#file_name = hand.py
from seq import getSeq
from oracle import Oracle
from get_tax import getTax
from insert_ import insert
from use_tax import useTax
def handPrint(oracle, **args):
'''手工发票'''
hand = Hand(oracle, **args)
hand.recordHandPrint()
args['sys_type'] = 'H'
... | Python |
#!/usr/bin/python
#encoding=utf-8
#file_name = use_tax.py
from update_ import update
from insert_ import insertLog
from get_tax import getTax
from oracle import Oracle
class UseTax:
def __init__(s, oracle, **args):
s.oracle = oracle
s.staff_id = args['staff_id']
s.tax_code = args['tax_code']... | Python |
#!/usr/bin/python
#encoding=utf-8
#file_name=oracle.py
import os
import cx_Oracle
import sys
from read_ini import read_db_info
class Oracle():
''' open oracle connetction get table_name and index info '''
pool = None
def __init__(self):
if(Oracle.pool is None):
getPool()
self.db ... | Python |
#!/usr/bin/python
#encoding=utf-8
#file_name = get_tax.py
from select_ import select
from oracle import Oracle
def getTax(oracle, staff_id):
where = {'staff_id':staff_id, 'state':'instance'}
from_sql = '''
from
(select *
... | Python |
#!/usr/bin/env python
#encoding=utf-8
import pyamf
from pyamf.amf3 import ByteArray
from twisted.internet.protocol import Protocol
from twisted.internet.protocol import Factory
from twisted.internet import reactor
from oracle import Oracle
from login import login
from exp import getExcInfo
from exp import getWa... | Python |
global bigzhu
def hello():
return 'hello %s'%bigzhu
| Python |
# -*- coding:UTF-8 -*-
from select_ import select
from update_ import update
from insert_ import insert
from insert_ import insertLog
from exp import Warning_
from delete import delete
def addStaffRole(oracle, **args):
'''增加工号角色 dic: role_id, staff_id, oper_staff_id'''
insert_value = args.copy()
del insert... | Python |
# -*- coding:UTF-8 -*-
''' 发票回滚 '''
from oracle import Oracle
from pool import selectPool
from datetime import datetime
from insert_ import insertLog
def roll(oracle, **args):
''' 发票回滚
tax_code
tax_nbr
oper_staff_id
remark
'''
sql = '''update pool p
... | Python |
# -*- coding:UTF-8 -*-
from select_ import select
from insert_ import insertLog
from update_ import update
from exp import Warning_
class AdjustError:
def __init__(self, oracle, **args):
self.oracle = oracle
self.args = args
self.tax_code = args['tax_code']
self.tax_nbr = args['tax... | Python |
# -*- coding:UTF-8 -*-
from pyamf.remoting.client import RemotingService
import logging
logging.basicConfig(
level = logging.DEBUG,
format = '%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
)
url = 'http://127.0.0.1:8001'
#url = 'http://135.33.9.54:8002'
client = RemotingService(url, logger = logging)... | Python |
# The default ``config.py``
def set_prefs(prefs):
"""This function is called before opening the project"""
# Specify which files and folders to ignore in the project.
# Changes to ignored resources are not added to the history and
# VCSs. Also they are not returned in `Project.get_files()`.
# No... | Python |
# -*- coding:UTF-8 -*-
from oracle import Oracle
def update(oracle, table_name, update_dic, where_dic = {}, and_the = ' ', count
= 1, need_lock = False):
'''更新表'''
#时间
temp_dic = update_dic.copy()
sysdate = []
for k, v in temp_dic.iteritems():
if(v == '/sysdate'):
del update_d... | Python |
# -*- coding:UTF-8 -*-
import sys
if(len(sys.argv) == 1):
raise Exception,'要输入表名'
table_name = sys.argv[1]
print ''
print 'create table %s_log as select * from %s where \
rownum<0;' % (table_name,table_name)
print ''' -- Add/modify columns
alter table %s_LOG add oper_staff_id NUMBER(12);
alter table %s_LOG add ope... | Python |
# -*- coding:UTF-8 -*-
from oracle import Oracle
def delete(oracle, table_name, where_dic = {}, and_the = ' ', count = 1):
'''更新表'''
sql = "delete from %s " % table_name
where = ' where 1 = 1 '
wheres = ["and %s = :%s" % (k, k) for k in where_dic.keys()]
where += ' '.join(wheres)
where += ' '+an... | Python |
# -*- coding:UTF-8 -*-
import os
import re
import sys
def get_pid(pid_name):
file_name = pid_name+'.pid'
f = open(file_name)
pid = f.read()
print "get %s's pid = %s"%(file_name,pid)
f.close()
return pid
def kill(pid,type = ''):
cmd = "kill %s %s"%(type,pid)
print cmd
os.system(cmd)
d... | Python |
#!/usr/bin/env python
#encoding=utf-8
import pyamf
from pyamf.amf3 import ByteArray
from twisted.internet.protocol import Protocol
from twisted.internet.protocol import Factory
from twisted.internet import reactor
from oracle import Oracle
from login import login
from exp import getExcInfo
from exp import getWa... | Python |
# -*- coding:UTF-8 -*-
import ConfigParser
def read_db_info():
config = ConfigParser.ConfigParser()
dic = {}
cfg_file = open('im.ini','r')
config.readfp(cfg_file)
dic['user'] = config.get('db_info','user')
dic['password'] = config.get('db_info','password')
dic['tns'] = config.get('db_info','... | Python |
# -*- coding:UTF-8 -*-
from oracle import Oracle
import xml.etree.ElementTree as ElementTree
from twisted.internet import defer
from select_ import select
from insert_ import insert
from insert_ import insertLog
from datetime import datetime
from update_ import update
from exp import Warning_
def getOrg(oracle, dic):
... | Python |
# -*- coding:UTF-8 -*-
from oracle import Oracle
import cx_Oracle
#cx_Oracle.CLOB
def addBbs(oracle, dic):
cursor = oracle.db.cursor()
cursor.setinputsizes(bbs_content = cx_Oracle.CLOB)
dic['bbs_content'] = str(dic['bbs_content'])
update_sql = "update bbs b set b.bbs_content = b.bbs_content||:bbs_cont... | Python |
# -*- coding:UTF-8 -*-
''' 入库发票作废 '''
from oracle import Oracle
from update_ import update
from datetime import datetime
from insert_ import insertLog
def nullifyDistri(oracle, **args):
''' 入库发票作废
distri_id
oper_staff_id
remark
'''
for k, v in args.items():
exec "%s = '%s'"%... | Python |
#! /usr/bin env python
#encoding=utf-8
#file_name = print.py
from oracle import Oracle
import seq
def getPrintSeq():
'''get print seq from '''
print_seq = seq.getSeq('print_seq')
| Python |
# -*- coding:UTF-8 -*-
from select_ import select
from types import StringType
from types import ListType
def insert(oracle, table_name, insert_value, count = 1):
''' insert sql 是根据第一行的內容来拼的.
如果一次插入多行,且插入列与第一行不同(有更的或者更少列插入),那么不要用这个函数.
'''
is_list = False
if(type(insert_value) == ListType):
... | Python |
#!/usr/bin/env python
#encoding=utf-8
import hashlib
from select_ import select
from update_ import update
from insert_ import insert
from insert_ import insertLog
from exp import Warning_
def login(oracle, **args):
'''登录工号 staff_id, passwd'''
for k, v in args.items():
exec "%s = '%s'"%(k,v)
sele... | Python |
# -*- coding:UTF-8 -*-
from pyamf.remoting.gateway.wsgi import WSGIGateway
from pyamf.remoting.gateway import expose_request
from twisted.web import server
from twisted.web.wsgi import WSGIResource
from twisted.python.threadpool import ThreadPool
from twisted.internet import reactor
from twisted.application import ser... | Python |
#!/usr/bin/python
#encoding=utf-8
#file_name = hand.py
from seq import getSeq
from oracle import Oracle
from get_tax import getTax
from insert_ import insert
from use_tax import useTax
def handPrint(oracle, **args):
'''手工发票'''
hand = Hand(oracle, **args)
hand.recordHandPrint()
args['sys_type'] = 'H'
... | Python |
# -*- coding:UTF-8 -*-
from twisted.web import static, server
from twisted.application import service, internet
from twisted.application import service, strports
path = '/acct/flex4/bin'
root = static.File("/invoice/flex4/bin/")
root.putChild("InvoiceSysOperateHelp.doc", static.File(path+"/InvoiceSysOperateHelp.doc"))... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.